Four books for C++ beginners

A common question from people new to programming is where to start. And the answers you get can be anything from “just start” to “read this insane number of books”.

In this post I will give a short list of books which we feel is a good way to go, if you are new to software development and C++.

Programming != Software Development

But first I want to talk a bit about why I generally don’t refer to myself as a programmer or coder, but as a software developer.

My distinction might not be one that everyone agrees with, but my main point is that creating software is about much more than ‘just’ writing code that works.

To create systems which are maintainable, robust, secure, effective etc. we need to look into much more that how our selected programming language works.

We also need to know about algorithms and data structures, software architecture, design patterns, protocols, etc.

This is of cause also why some people (like myself) can spend years on getting fancy university degrees on the topic 😉

But I don’t want to be a professional!

I hope I haven’t scared you away already.

Maybe you think the above is all fine, but you don’t want to be a professional developer. You just want to write some code and create cool stuff in your spare time.

That is perfectly fine!

And I really hope many more will start dabbling with software development in their spare time.

I only want to make beginners aware of the fact, that there are so many interesting things to explore. And if you feel stuck at some point, the solution might not be in examining your chosen language further, but instead you might progress by learning about other parts of software development.

4 books for C++ beginners

And after this long introduction I am finally ready to give you a list of four books, which I feel are perfect for beginners to software development and C++.

For book 1, 3 and 4 it is important to get the newest edition which is update to at least C++11.

1. Beginning C++ Through Game Programming by Michael Dawson

This book is a introduction to programming and C++. It is for beginners with little or no experience with programming.

Since the basic concepts of if-statements, loops, functions, classes etc. are almost identical for most object oriented programming languages, you could also start with this book even if you don’t plan on digging deeper into C++ later on.

It is first and foremost an introduction to programming and only scratches the surface of C++.

This book is not only for people interested in game programming. It is also absolutely not an introduction to game developement.

However, most of the examples and exercises are related to game development which makes them relatable for most people. It also makes the exercises lighter than some of the exercises seen in other books.

With its 416 pages, Beginning C++ Through Game Programming is also short compared to some of the other introductory books we have on our book shelf at my house.

Actually finishing your first programming book can really boost you confidence, which is why I generally don’t recommend choosing a book with 600+ pages for you first programming book.

2. Clean Code by Robert C. Martin

The second book on the list is the main reason for the long introduction 😉

Writing code can be easy, but writing good code can be more difficult and requires thought and practice.

If you have only tried to write very small programs, you might not see the true benefit of clean code yet. However, once you start working on slightly larger projects or together with other developers the benefits will quickly emerge.

Clean code is about writing readable code. The way you structure you code and name you functions and variables effect how easy it is for others to read and understand you code. And by others I also mean yourself in 3+ months 😉

An important thing to note is also that clean code does not necessarily mean effective or short code. The best solution is often the one easiest to understand, not the one using the fewest lines of code or the one which is fastest to execute.

I recommend Clean Code as the first book after you’ve learnt the basics of programming. The book is not language specific so you can read it no matter which programming language you currently know or prefer.

Again this is a somewhat short book of 464 pages and is also a really easy read.

3. C++ Primer by Stanly B. Lippman, Josée Lajoie and Barbara E. Moo

Okay so now you know the basics of programming and you also have an idea of how to write clean code.

This is good time to dig deeper into C++. For this I recommend C++ Primer (not to be confused with C++ Primer Plus).

If you are new to C++ but know the basics of programming from another language, this book is also a good introduction to C++.

With its 976 pages it is a longer read than the previous two books. But at this point I don’t think it matters how long the book is.

The book covers the language more in-depth then a book for complete beginners.

I recommend reading this book cover to cover, but maybe skip some of the exercises for the parts you are already familiar with.

At this point a book should also not be you main development activity. Instead you should spent time working on small projects or solve selected programming challenges and read this book on the side.

4. The C++ Standard Libray: A Tutorial and Reference by Nicolai M. Josuttis

This is the first book I do not recommend reading cover to cover. Instead it is a reference book to the C++ Standard Template Library (STL).

I know many feel that reference books are outdated, since you can easily look up things on google and find information about STL on sites such as cppreference.com and cplusplus.com.

However, I still recommend having this book on the shelf and referring to is when you feel you need to use a part of STL you haven’t touched before.

Why? Well when using google you often end on a page for a very specific part of STL. But maybe the best solution was actually something slightly different than what you imagined.

The C++ Standard Library not only holds specifications for STL, it also has introductions to the different parts of STL and examples on what to use when and why.

An example might be the first time you want to use several threads.  You might google “C++ stl thread” which will lead you to a page on std::thread which is then what you’ll end up using.

However, another more beginner friendly solution could be to use std::async instead. Which you would be introduced to if you looked up concurrency in this book.

Practice makes perfect

This is the end of my book list for C++ beginners.

Don’t just read all four books in a row without practicing in other ways as well. Experiment with the exercises while you read the first book.

Once you are done with the book number one, practice what you’ve learnt while reading the other books. Make small programs you come up with yourself, or try to solve some of the many programming challenges you can find on the internet.

And remember there is always new things to learn about all aspects of software development. This post was on the first four book I would recommend to beginners. But I have many more books to recommend for another time 🙂

/Signe, Makertech.dk


Posted

in

by