Book review: Think Like a Programmer
Tags: books, book
Published: 2019-05-03 09:01:06

---
title: Book review: Think Like a Programmer
published: true
tags: books,book
canonical_url: https://flaviabastos.ca/2019/05/03/book-review-think-like-a-programmer/
---

> Note: I’m not being paid or receiving any kind of compensation for this review.

> TL;DR: This is a very good book. If you are a software developer I highly recommend it!

![](https://testfbdotblog.files.wordpress.com/2019/04/think_like_programmer.jpg?w=620)<figcaption>Book cover of “Think Like a Programmer”, by V. Anton Spraul</figcaption>

Earlier this year I finished reading: [Think Like a Programmer: An Introduction to Creative Problem Solving](https://www.goodreads.com/book/show/13590009-think-like-a-programmer), by V. Anton Spraul and I highly recommend it, not only for software developers, but to anyone who wants to learn some techniques about problem solving and how to approach a puzzle or problem. Granted, it will be a lot easier if you know one programming language (or two, or five!) since all the coding examples are written in C++ but there are principles that apply to any kind of problem solving, such as:

> When solving problems, working with a specific goal in mind is always better than random effort, whether you achieve that specific goal or not.
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 507</cite>

Even though I don’t know C++ (I am sort of learning C#/.NET now), most – if not all! – the coding examples are easy to understand and are always followed by a line-by-line explanation, so not knowing C++ shouldn’t prevent anyone from checking this book out. Also, the author is an experienced teacher and his explanations are very comprehensive.

I have to admit that it took me quite a long time to get through the book (6 months, when I usually read a whole book within a week or two, tops). It’s not a simple read but I believe it’s well worth the time. I also have to admit that despite the author’s plead for readers to complete the exercises proposed at the end of each chapter, I didn’t do any. ¯\_(ツ)\_/¯

Enough rambling! Here are some of my highlights:

**Programming is an art, y’all!**

> Make no mistake: Programming, and especially problem solving, is a creative activity. Creativity is mysterious, and no one can say exactly how the creative mind functions.
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 222</cite>

**Planning before acting is not a waste of time!**

> In solving programming problems, we are sometimes faced with situations where we can’t see a clear path to code the solution, but we must never allow this to be an excuse to forgo planning and systematic approaches. It’s better to develop a strategy than to attack the problem through trial and error.
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 499</cite>

> This is perhaps the most important rule. You must always have a plan, rather than engaging in directionless activity.
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 635</cite>

> Restating a problem is like circling the base of a hill that you must climb; before starting your climb, why not check out the hill from every angle to see whether there’s an easier way up?
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 664</cite>

**Break it all down!**

> Finding a way to divide a problem into steps or phases can make the problem much easier. If you can divide a problem into two pieces, you might think that each piece would be half as difficult to solve as the original whole, but usually, it’s even easier than that.
> 
> <cite>V. Anton Spraul, on “Thinking Like a Programmer”, location 682</cite>

And a lot more! Special shout out to chapter 6: “_Solving Problems with Recursion_“. I thought I understood recursion before reading this chapter but it helped me see it through a different angle.

> _The post_ [Book review: Think Like a Programmer](https://wp.me/pa0b0y-3F)_was originally published at _[flaviabastos.ca](https://flaviabastos.ca/)