Home Page -------------------
[Home Page] - [Reviews Main]
-------------------

Book Review
Writing Efficient Programs by Jon Bentley
Highly Recommended
ISBN: 0-13-970244-X       Publisher: Prentice Hall       Pages: 170pages       Price: £17-85
Categories:   writing solid code     advanced c    
Reviewed by Jon Jagger in C Vu 7-5 (Jul 1995)
Bentley has (to my knowledge) written three books. This one, the marvellous 'Programming Pearls' (reviewed elsewhere in this issue) and the follow up 'More Programming Pearls'. The latter was reviewed by Francis in C VU 4.4 with high praise. This too is a real gem of a book. The kind you find only rarely. It is packed full of real programming bottlenecks and how they were honed and tuned. I colloquially call my copy 'the optimisers bible'. The examples are mostly in Pascal, but are not language specific and the aha- insights easily carry over to C. To whet your appetite some of the chapter sub headings are; Trading Time for Space, Trading Space for Time, Loop Rules, Logic Rules, Procedure Rules, Expression Rules. This book is of real benefit if you ever need to optimise code. Obviously. I think it is also of real benefit even if you don't. Aha-insights have an inherent worth and beauty. They make you think and give you an extra dimension, a deeper understanding, to call one when thinking about programming or problem solving in general. Here's a concrete fragment in C.

Question. How can you speed this up? for (i = 0; i < N; i++) x[i] = x[i] * exp(sqrt(PI/2)); Answer...

 	factor = exp(sqrt(PI/2));
	 for (i = 0; i < N; i++)
		x[i] = x[i] * factor;
Old hat to most of you no doubt. Its called 'CISBN ding motion out of loops.' How many of you are aware that the technique can actually increase the run-time though? Think about N == 0. The book is full of insights like that. I've heard that new recruits at Microsoft are not allowed to start coding until they have read a required reading list of 10 books. I'd put money on this being on the list. Get it. Read it.
Other Authors with the same surname

Bentley
More Programming Pearls, Confessions of a Coder by Jon Bentley [Highly Recommended]  (Reviewed May 1992)
More Programming Pearls by Jon Bentley [Recommended]  (Reviewed May 1996)
Programming Pearls 2nd ed. by Jon Bentley [Highly Recommended]  (Reviewed Jan 2000)
Programming Pearls by Jon Bentley [Highly Recommended]  (Reviewed May 1995)


Last Update - 13 May 2001.

To link to this review, please use the URL: http://www.accu.org/bookreviews/public/reviews/w/w001428.htm

Copyright © The Association of C & C++ Users 1998-2000. All rights reserved.

Mirrored from http://www.accu.org/