Title: Efficient C/C++ Programming Author: Steve Heller Publisher: AP Professional ISBN: 0-12-339095-8 Info: 411 pages (softcover) with code disk Price: L29.95This book provides C and C++ programmers with several real-world examples on how to optimise their code. Unfortunately for C++ programmers, only one of the eight chapters is about C++ efficiency, the others are only on C.
In the book, efficient C/C++ programming and optimisations are presented at the algorithmic level, which is always more effective than plain syntax code optimisations (an assembly version of bubble sort is still slower than a plain C/C++ version of quick-sort). I'm very happy that the author never fears to use Turbo Profiler to show the effects of his optimisations or to find the bottle-necks in his code. Steve feels that you cannot guess the bottle-neck; you must actually search and find it to be sure!
Among the several real-world programming techniques and algorithms that are covered are soring, hasing, data compression and a new fast so-called quantum file access method which allows efficienct access to variable length records. Each subject is covered in a separate chapter, and each chapter consists of two parts: the introduction to the problem and detailed analysis with fast solution, and second the source code itself. Often, however, the source code consumes more pages than the text itself, which gives the feeling that the book is more a source code listing than a textbook with algorithms (I counted 229 pages with code listings, of 411 total pages!). I'd have prefered a kind of mixed approach where interesting parts of the listings are interwoven with the text. Now, more than half of the book will remain unread, as it is just plain code that can be found on the accompanying code disk! Another weak point of the book is the rather short index of three pages. Even the little amount of actual text deserves more than three pages, while the authors own 'quantum' stuff got a whopping 21 references!
Now, please don't think that this is a 'bad' book. On the contrairy, I rather liked it, as it's one of the first efficiency books to truly deal with real- world problems and solutions. The author shows his experience while treating the different problems, and examining different possible solutions and their efficiency. The use of Turbo Profiler shows that Steve really knows that only the final cold facts count. I wish that every C/C++ programmer (or at least the onces who work with me) would have read the book, so they can make good technical decisions prior to buidling a new application. So no unpleasant efficiency surprises will await when the application is ready but slow as an old dog.
If you're not afraid of the unnecessary code listings in the book, or if you know that C/C++ efficiency is an issue for you, then this book should be on your desk. If you don't care about efficiency, or think that any performance problem can be solved by adding a bigger CPU or more RAM, then I invite you to read this book, and see if you still think so afterwards. I think not.
In short, this book can be an indispensable cookbook for you when it comes to the art of real-world efficient C/C++ programs.