C++ for dinosaurs
This book is 100% complete
Completed on 2014-07-25
About the Book
There are certain programming habits that tend to produce unreadable and low-performance code. These habits are inherited from dated code, or passed on from trainer to trainee.
Readability should be the prime aspect of your code, because it has the highest return on effort, compared to other techniques which aim to improve your product's quality.
- Quality: Bugs are found mostly by reviewing other people's code. You can't review somebody else's code if you cannot read it. Bugs are not found by unit-tests, because unit-tests are created to capture errors that we know they exist in the code. Unit-tests only catch bugs that have been re-introduced.
- Efficiency: Maintenance takes about 80% of developers' time. Therefore, spending some time for writing better code will save you up a lot of time when you have to maintain it.
- Performance: Unreadable code is difficult to reason about. Therefore any opportunities for optimisation that may exist are often impossible to notice and fix.
I describe six basic techniques that you can follow in order to eliminate these habits. These techniques can be learned one at a time, improving your coding level progressively. At the end, you will have developed a programming style that
- is more readable,
- leads to more maintainable code,
- promotes reusability, and
- often leads to faster code.
All these qualities are not mutually exclusive, you will often achieve all of them at the same time.
The techniques are easy and therefore
- students can apply them
- it helps smooth transition from C to C++, without having to change programming paradigm
- it allows C++ programmers to write using native idioms, instead of writing like C, Java, or Fortran.
C++ for dinosaurs is also available as a printed book at lulu.com.
The Leanpub Unconditional, No Risk, 100% Happiness Guarantee
Within 45 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
See full terms