The best books for "doing it right" in your programming language

Who am I?

I love computer programming books almost as much as I love computer programming. As a high school student in 1980 I remember typing in really frustrating source code from the book BASIC Computer Games. Was programming meant to be a black art? Was code supposed to be an impenetrable mess of buried intent? When I started getting paid to program, I was happy to see that the answer to both questions was "no." I began to seek and enjoy books that espoused the "right" way to code in a given language. Here is a handful of books that have helped me and countless others learn to produce correct, clear, and maintainable code.


I wrote...

Modern C++ Programming with Test-Driven Development: Code Better, Sleep Better

By Jeff Langr,

Book cover of Modern C++ Programming with Test-Driven Development: Code Better, Sleep Better

What is my book about?

Test-driven development is but a simple concept: write a small amount of test code to describe a desired outcome; craft just enough code to reach that outcome; and use the resulting tests to your advantage, and by ensuring that the code is as clear and concise as possible before moving on.

I strove to create a book that captured the best possible way to grow a system incrementally and to provide the most comprehensive treatment of TDD to that point in time. It shows how to "do TDD right" and sustainably, as well as how to enjoy it. It also demonstrates to C++ developers that there's no reason they too can't practice TDD.

The books I picked & why

Shepherd is reader supported. We may earn an affiliate commission when you buy through links on our website. This is how we fund this project for readers and authors (learn more).

Effective C++: 55 Specific Ways to Improve Your Programs and Designs

By Scott Meyers,

Book cover of Effective C++: 55 Specific Ways to Improve Your Programs and Designs

Why this book?

C++ is a tricky, beastly language, and there are no end of ways to program either incorrectly or inefficiently with it. Meyer's 1991 book set the bar high for similar books to come, providing great, detailed explanations about the language's pitfalls and how to avoid them. After reading Effective C++, though, you might find yourself wondering why you are coding in C++: The tips reveal so many insidious ways to shoot yourself in the foot, and worse, sometimes in a way that you won't even notice that your little toe is missing.

Effective C++ and the two follow-ons are essential reading for anyone working in C++. Nowadays you can purchase a digital edition that provides 140 total ways—adding in 50 additional tips from More Effective C++ and 40 from Effective STL.


Smalltalk Best Practice Patterns

By Kent Beck,

Book cover of Smalltalk Best Practice Patterns

Why this book?

While Smalltalk has been relegated to a tiny niche in the field of currently-used programming languages, I loved the opportunity to work with it many years ago. Smalltalk, an object-oriented language, is powerful but conceptually simple – you can learn the syntax in about 15 minutes. You can also produce highly expressive, clearly-stated yet compact code in Smalltalk.

In Smalltalk Best Practice Patterns, Kent Beck took the approach of expressing each recommendation in the form of an "implementation pattern:" a named technique that provides a recipe for addressing coding problems. Each pattern is short and sweet – you can read a page or three describing the problem's constraints and context, then see a succinct example of how to apply the right technique (and perhaps an example of how not to do things).

Even if you don't program in Smalltalk, or don't plan to, Smalltalk Best Practice Patterns remains a worthwhile and enjoyable read over 25 years after its publication.


Effective Java

By Joshua Bloch,

Book cover of Effective Java

Why this book?

When seeking a book on how to use a language effectively, getting one written by someone who helped design and implement the language is usually a great idea. With Effective Java, you get a book written by someone who contributed a significant amount to the language: Joshua Bloch had a lot to do with the design of the Java 5.0 features circa 2004, which is where Java moved for me from "inelegant" to "hey I can finally make things look good in this language." Bloch goes into considerable and passionate depth about each of the 90 items in the 2018 edition and will help you ensure you don't make the mistakes that can lead to defective or bad code.


JavaScript: The Good Parts: The Good Parts

By Douglas Crockford,

Book cover of JavaScript: The Good Parts: The Good Parts

Why this book?

During my first few weeks of JavaScript coding, I encountered what seemed to be an endless number of head-scratching moments: "I'm slowly reading the few lines of code I just wrote, it seems fine, so why isn't it doing what it looks like it should be doing?" Even more insidious at times than C++, JavaScript contains a number of fairly clever constructs, including things like hoisting, duck typing, and a loosey-goosey argument passing mechanism. This concise tome of fewer than 175 pages helped get me past those first few months, and as an author-stated goal, it helped me "learn to think in JavaScript."


Practical Object-Oriented Design: An Agile Primer Using Ruby

By Sandi Metz,

Book cover of Practical Object-Oriented Design: An Agile Primer Using Ruby

Why this book?

When learning a new language, you'll want to avoid the mistake of assuming that you can adapt your old way of doing things to your new language (like I first tried many years ago). Even though Java and Ruby are both object-oriented languages, the "right" approach to implementing things is dramatically different between the two. Practical Object-Oriented Design in Ruby makes it easy to learn how to apply object-oriented design and to implement the code properly in Ruby, making your system easier to change as it grows.


3 book lists we think you will like!

Interested in object-oriented programming, computer programming, and python?

5,888 authors have recommended their favorite books and what they love about them. Browse their picks for the best books about object-oriented programming, computer programming, and python.

Object-Oriented Programming Explore 7 books about object-oriented programming
Computer Programming Explore 23 books about computer programming
Python Explore 25 books about python

And, 3 books we think you will enjoy!

We think you will like Introduction to Machine Learning with Python, Data Structures and Algorithms, and Beyond the Basic Stuff with Python if you like this list.