Somewhat OT: The Best Book I've ever Read

The C Programming Language – Brian Kernighan and Dennis Ritchie

The first edition of this book is the first book on C that I’d ever read back in the 80’s. It is by far the best book on C out there. Short and sweet and full of simple examples. Co-written by the inventor of the language (and indeed co-designer of Unix itself), it is the Strunk and White of programming manuals.

The second edition covers ANSI C, which is a more modern version of the language.

Since most of Blender is written in plain C, I think trying to learn C++ will just confuse people. In many respects C++ is a very different language, although the two can be mixed by experienced programmers.

If you find a copy of The C Programming Language in a used bookshop, or possibly online (google is your friend), I recommend that you buy it and read it from cover to cover! :slight_smile:

I still keep my beat up copy as a reference.

I’m a bit hesitant to recommend K&R, as a lot of the code there demonstrates quite a bit of bad practice (Unreadable nested loops for example), and its explanation of pointers is really lacking.

I have a copy of K&R and on the whole is a good book. But as dsavi pointed out there are points where explanation is lacking and the example code is not always clear. Also, I find that the book jumps in difficulty very quickly. But if you’re going to get K&R then The C Answer Book is a helpful companion.

I don’t know about others, but, I found C++ a bit easier to get to grips with than C to begin with, and in knowing some C++ I find it a lot easier to pick up C (the greater use of abstraction in C++ I think really helps in learning it). I also find them easy to separate using a simple test!: if it’s a modern helpful feature then it’s probably not in C :stuck_out_tongue:

As for the best book, I’ve only read K&R for C, but I found C++ through game programming (second edition) really accessible, followed by accelerated C++.