[Home Page] - [Reviews Main] | |
|
C++ and C Efficiency by David Spuler Recommended |
| ISBN: 0-13-096595-2 Publisher: Prentice Hall Pages: 230pp Price: £18-95 |
| Categories: optimization advanced c advanced c++ |
| Reviewed by Francis Glassborow in C Vu 5-4 (May 1993) |
The theme of the book is that it is the programmers job to write programs and select algorithms that will produce efficient executables (either compact or fast or a balanced mixture). Compiler optimisers support you but in the final analysis it is the programmers job. An added factor is that many of the most dramatic improvements come from using a different algorithm or even making a slight modification to the one you are using.
Unfortunately the author does not distinguish clearly between methods that are essentially programmer based (and likely to remain that way) from those that are well within the range of a good optimiser. For example, moving variable assignments out of loops is a good compiler's job these days; rewriting a search of random data to use a sentinel is a programmers job. Realising that this technique is available for an arbitrary linked list is a valuable insight.
If you have ambitions to being a craftsman rather than just someone who knocks up a solution then this is a book that you should read and pass on. It has a number of good ideas but the best is the one that the author never makes explicit, there is no substitute for understanding the tools of your trade, in the case of programming your most important tools are the algorithms.
To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/cp/cp000358.htm
Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.