|Think Like A Programmer|
|author||V. Anton Spraul|
|publisher||No Starch Press|
|summary||An Introduction to Creative Problem Solving|
Different types of problem solving are discussed in separate chapters which cover the use of data structures, pointers, recursion and code libraries before wrapping up with a final chapter that brings all the previous approaches together. The book is intended to be read in its entirety with later chapters making frequent references to topics covered earlier. Think Like A Programmer is not a cheat sheet or cook book with quick fixes but a more substantive book that rewards those who read it as thoroughly as it has been written. Each chapter contains a few examples which are used to explain the topic under discussion and these have been well chosen to illustrate the key concepts. A series of exercises are also included which build on and extend each chapter. The author stresses that if the reader really wants to learn something and improve their problem solving skills then these exercises should be considered even more important than the text. The best way to learn how to program is by doing and the exercises force one to put what one has just learned into practise. The first few exercises at the end of a chapter are relatively simple and are basically variations on the examples that help the reader build confidence before moving into more challenging and tricky exercises that push one to apply one's recently acquired knowledge to new limits.
Throughout the book everything is explained in a good level of detail and enough background information is provided so that the reader should never feel out of their depth. The pros and cons of the various presented solutions are clearly weighed up with logical backing. The author is obviously very knowledgeable and experienced with teaching hard concepts to new learners and this shows in his no-nonsense, down-to-earth but enjoyable writing style. The code samples are clear and well thought out as are the diagrams that accompany the various examples. The chapter on classes was the only one where I felt like focus was being lost due to too many C++ implementation details but perhaps that's just the nature of the language. I would have liked the example here to show more clearly how classes can turn a morass of functional code into something more logically grouped and easier to understand. To be fair, the exercises at the end of this chapter do ask one to do this by asking one to convert a collection of string utility functions into a more logically organized string class. This again shows the importance of actually doing the exercises and not just simply reading them.
The core idea of how programmers take a complex problem and then break this down into smaller, more manageable and solvable parts is well described. The importance of having a plan before jumping in and writing code without thinking is stressed and there are great suggestions for how to take stock of your own personal strengths and weaknesses and come up with a personal plan that works for you. The example is given of someone who likes jumping right into coding — for someone like this it probably makes sense for them to do early prototyping as a way to start solving a particular problem, as long as the longer term plan involves taking a step away from this and incorporating the lessons learned into a more thoroughly thought out solution later. In this, as in the rest of the book, the author shows his years of experience teaching a wide range of people with different skill sets and approaches to problem solving. There is no single way to think like a programmer, but rather a number of tried and tested strategies that can be employed in various ways. Think Like A Programmer captures this core idea in an satisfying, down to earth manner and I can highly recommend it to anyone wanting to improve their problem solving capabilities. I wish I had had this book when I started studying computer science — the fundamentals contained here would have been a valued addition to the text books teaching syntax and specific technologies.
You can purchase Think Like A Programmer from amazon.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.