Reader-supported: when you buy through links on our site, we may earn an affiliate commission. Learn more

Cover of Think Like a Programmer
Buy on AmazonBuy on Bookshop.orgListen on Audible

We earn a commission if you buy through these links. Learn more

Find Similar Books

Think Like a Programmer

by V. Anton Spraul

Tech
★★★★★5.0 (1)

A beginner's programming book that teaches how to approach problems, not just which syntax to type, using open-ended exercises that reward slow, deliberate thinking.

What It's About

Think Like a Programmer is an introductory programming book that treats problem solving as its main subject and uses C++ as the vehicle. Spraul is less interested in where the semicolons go than in showing how a programmer moves from a vague goal to a working plan. Most chapters take a single concept, such as loops, functions, classes, pointers, or recursion, and use it to illustrate a way of approaching problems rather than just a feature of the language.

The reading experience is closer to a workshop than a reference book. The exercises are open-ended, so there is often no single right answer, and working through them is where most of the learning happens. You will be asked to break a problem into parts, choose a data structure, and weigh tradeoffs. Expect to get stuck and then find your own way out, because the book trusts you to do that work.

Because the examples are in C++, you meet pointers and dynamic memory directly rather than having them hidden behind higher-level abstractions. The emphasis on method, such as splitting problems up and organizing your thinking before writing code, carries over to any language. It reads as a patient, practical companion for someone who has tried a language or two and wants to understand why code is shaped the way it is.

Read this if you…

  • want to learn programming but feel stuck on how to start solving a problem
  • enjoy open-ended exercises and don't mind working slowly through hard questions
  • want a foundation whose lessons still apply after you move on from C++

Skip it if you…

  • want a quick language reference or a fast route to building a specific app
  • are looking for a current guide to modern C++ features and idioms

Key Ideas

  1. 1

    Problem solving is a skill separate from syntax

    The book's central claim is that knowing a language's rules is only part of programming. The harder part is turning a fuzzy goal into a sequence of steps a machine can follow. Spraul treats that translation as a learnable skill, and each chapter asks you to practice it rather than simply memorize the feature under discussion.

  2. 2

    Decomposing problems before writing code

    A large problem becomes manageable when you split it into discrete pieces that can be solved and tested separately. The book repeatedly models this habit, showing how to name the parts, decide what each one must accept and return, and only then fill in details. The approach works as well on paper or in your head as it does at a keyboard.

  3. 3

    Choosing the right data structure for the job

    Many programming difficulties are really difficulties of representation. The same task can be easy or painful depending on how the data is stored. The book encourages you to ask what operations you need most often and to pick a structure that makes those operations natural, rather than defaulting to whatever you saw first.

  4. 4

    Recursion and dynamic memory as thinking tools

    Recursion and manual memory management are often taught as hurdles to be cleared. Here they are presented as ways of structuring a solution. Recursion shows how a problem can be defined in terms of smaller versions of itself, and dynamic memory shows how a program can decide at runtime how much space it needs.

Limitations

The book predates recent C++ standards, so modern language features and idioms are largely absent, and some code style will look dated to working developers. Readers who want a steady supply of worked answers may find the open-ended exercises frustrating, since the book prioritizes your own reasoning over complete solutions. It does not cover web development, frameworks, or professional tooling, and its treatment of algorithms is a starting point rather than an in-depth survey.

Questions Readers Ask

Do I need to know C++ before reading Think Like a Programmer?
No. The book is written for people new to programming and introduces its C++ material gradually, one concept per chapter. The language is mainly a vehicle for the problem-solving ideas. If you have never written code, expect the early chapters to be approachable but the exercises to take real effort.
Is it still worth reading given its age?
Yes, for the problem-solving method, which does not depend on any version of the language. The specific C++ conventions and tooling are dated, so pair the book with a current language guide if you plan to write production code. The habits it teaches, such as decomposing problems and choosing data structures deliberately, remain useful.

What Creators Say About Think Like a Programmer

Reviews from readers on YouTube. Their opinions are their own.

Dynamic Programming (Think Like a Programmer)V. Anton Spraul on YouTube
RUA Programmer? (Think Like a Programmer)V. Anton Spraul on YouTube
Published
2012
ISBN
9781593274566
Difficulty
beginner
Category
Tech

Book details and cover from Google Books.

Ready to read Think Like a Programmer?

Get your copy on Amazon, or listen to it on Audible. We earn a commission if you buy through these links.

Books Like Think Like a Programmer

View all →
Cover of How to solve it

How to solve it

George Pólya

A classic guide to breaking problems into parts and testing strategies, the same habit Spraul builds through his exercises. Its heuristics apply well beyond mathematics, as the source book also argues.

Cover of Algorithms to Live By

Algorithms to Live By

Brian Christian, Tom Griffiths

Shows how computer science ideas help with everyday decisions, echoing Spraul's view that programming thinking reaches outside the field. Readers who enjoyed his broader lessons will find its examples engaging.

Cover of Mindstorms

Mindstorms

Seymour Papert

Explores how learning to program changes the way people think about problems. Readers drawn to Spraul's emphasis on creative problem solving will appreciate Papert's approach to learning through building.

Cover of The Pragmatic Programmer

The Pragmatic Programmer

Andrew Hunt, David Thomas

Offers practical habits for writing and maintaining code, complementing Spraul's focus on organising thoughts. Its short, concrete tips suit readers who want to apply problem-solving skills in real projects.

Explore More