The idea of building simple code that's easy to maintain generates debate at both a philosophical and a practical level. What to we mean by "simple", how do you get there – use a model with comments or just an economy of code - and, importantly, who the hell built this mess? That kind of stuff. Technology veteran Scott Bain's …
Missing the obvious.
The first bloody principle of writing code is:
-The software must be easy to use.
You can imply as many other concepts from this as you want but it is the underlying principle of all good software, it applies as much to end users prodding some user interface as it does to other developers poking your API.
Encapsulation may follow from this rule, but does not always, same with most of the other low level coding practices that people whale on about from time to time.
What will make this 20-year-old advice easier to follow today than it was way back then?
I believe Edsgar Dijkstra said something that ammounted to "if you could program a computer in simple english sentences, you would discover that programmers cannot write simple english sentences." It's absolutely true that good cohesion and separation of concerns are two aspects of a clear program. Knowing that fact does not, apparently, induce programmers to write in that fashion.
@ A. Riley
The article is about writing code in general, not writing UIs. You can have a very easy-to-use app with a completely kludged-up code and vice versa.
Before you shout it down...
Understand the audience that is likely to want to read a book like this. I've been programming for longer than I care to remember (about 25 years all told), and I'm considered at the top end of C++ experts. I still find occasional gems in most books that I read. Yet one of the most common questions that people ask me is: I'm learning how to code <insert language here>, can you recommend some books. Now with C++ you can recommend people go and read Stroustroup, or Thinking in C++ by Bruce Eckel, or Accelerated C++ by Koenig and Moo.
But then I come to a much bigger problem. For someone who is trying to learn how to design code where do I point them. The gang of four book on Design Patterns, or the Pattern Oriented Software Architecture series are great - but they are not beginner's books. Modern C++ Design by Alexandrescu fits into the same category. Meyers' or Sutter's books on gotchas and pitfalls are excellent - but not really design books. I quite often point people at an excellent book I read many years ago called Clouds to Code, but it isn't really C++ oriented. It is here that I get stuck on what to recommend. A book that filled this space - a beginner's/intermediate's guide to writing well designed maintainable code is definitely needed.
Now whether Scott's book fills this mould or not only time will tell. I hope it does. Ideally I want to have a book to teach design by case study and example - I don't know whether this is what Scott does - I'll have to read the book and find out...
- Vid Google opens Inbox – email for people too thick to handle email
- RUMPY PUMPY: Bone says humans BONED Neanderthals 50,000 years B.C.
- Pic Forget the $2499 5K iMac – today we reveal Apple's most expensive computer to date
- Is your home or office internet gateway one of '1.2 MILLION' wide open to hijacking?
- Review Vulture trails claw across Lenovo's touchy N20p Chromebook