Book Recommendations -------------------------------------------------------------------------------- Note: I uploaded all three of these books as PDFs in the same folder which contains the file you're currently reading. 1. The C Programming Language by Kernighan and Ritchie Commonly called "K&R", you will see this book discussed all over the place when it comes to C since it was the first book on the subject and one of the authors (Ritchie) is also the creator of C (and is one of the two creators of Unix). This is the book I learned C from and despite its age I still recommend it. There have been very few changes to C over the years and all the changes tend to be categories of additions to the language (e.g. multithreading) rather than changes to existing behavior. The other author (Kernighan) is the same person that wrote other classic programming books like The Art of Computer Programming. In typical 1970s computer book style, this book focused on brevity, however, it also makes few assumptions about your current knowledge level, instead explaining concepts from the ground up when they are introduced. For that reason, I think it's an excellent first programming book. 2. Beej's Guide to C Programming by Brian "Beej" Hall Compared to the previous recommendation, this book (and Beej's book on network programming in C) is more modern and has a very conversational tone. Reading it feels more like a friend casually walking you through the language, cracking jokes along the way, though the book is still quite rigorous. I like Beej's style a lot but some people prefer something a bit more formal. 2. Modern C by Jens Gustedt Whereas K&R (the first recommendation) was the canonical C book from the 1970s to the early 2000s, this Modern C book is probably the most recommended for learning in the past fifteen-ish years. Although I've read it, I was already well established as a C programmer at the time, so it's difficult for me to say whether it's a good starting book or not. However, as I said, I've seen a lot of other people recommend it to C beginners, and I find it to be a solid, comprehensive book, so I'm including it here. Learning Recommendations -------------------------------------------------------------------------------- 0. Why C? -- Given that it's 50-ish years old, I feel like I should give a little explanation *why* I recommend C as a starter language. That way, if my reasons don't match up with your goals, you won't waste your time. Simply put, C is like the 'english' of computer languages in terms of its world-wide ubiqiuty. Any new language (e.g. Python, Java, etc) that wants to interact with other software written in other languages does it through a C FFI (foreign function interface) and talks to the OS via a C ABI (application binary interface). Many programming textbooks use C or pseudo-C for the examples. When you leave the PC world and work on the larger realm of computing (e.g. microcontrollers, embedded devices like the computer in your car or fridge, equipment controllers, etc) they tend to be written in C. Even other programming languages like Python are themselves written in C (see: the CPython interpreter). So if you learn C, then you're learning the language that sits beneath pretty much every aspect of computing. Moreover, C doesn't protect you from yourself. It exposes programming at a very raw level and the lessons/habits you learn will serve you well in every other language you learn later. 1. Do the exercises! -- All of these books include practice problems. Some of them, like the K&R book, intentionally use the problems to teach you new concepts that aren't covered in the main text. Moreover, you should always be writing code, not just reading it. No matter how trivial it is at first, put everything you learn into practice and you'll find it much easier to understand over time. Also, *reading* code is just as much of an acquired skill as *writing* code. Pretty early on you'll want to start reading other people's C code to help you get out of the 'early programmer' bubble. I can give you some examples when you're ready. 2. Versions of C -- The original C was created so that Unix could be written in it. At first there were no reference manuals. After some time, the first edition of the K&R book was written and served as the definition of the language. In 1989, C was adopted as an ANSI standard named C89. You can safely ignore pre-ANSI (aka: K&R) C code at this time but you'll need to know C89. In 1999 C99 was formalized, then C11 in 2011 and C17 in 2017. There have been a few changes over the years but none of them change the core language itself. I (and others) still frequently write code in strict C89 for maximum portability. Most of the modern changes to the language have been extensions to support new ways of interacting with the underlying hardware (e.g. multithreading and atomic operations) or new ways of exchanging data (e.g. Unicode support). IOW, you won't be wasting any time if you learn C89 since nothing about it goes away in the newer versions, they only add feature sets alongside it. 3. Which book? -- When learning from books, I tend to read 2-3 books on the same subject at the same time. Specifically, even if I have to skip around a bit in order to get topics to line up, if the first book introduces a new concept like "arrays", then I like to go read the section of the other two books that cover arrays. This allows me to hear about the new topic from disparate POVs, helpful since the author isn't around for me to ask questions of. Frequently I find that one author's explanation helps me identify gaps in the way I understood one of the other author's explanations. So my recommendation is to read all three books at the same time, reading one in order and skipping around in the other two as needed. 4. IRL help -- Don't study alone. Find a programmer IRL that you can ask questions and who can periodically look at your code as you learn. There is so much more to good programming that just the language and an IRL programmer can help you identify bad habits early, as well as clarifying confusing points early, before you get frustrated/stuck on them. I'm happy to help in any way I can, so don't be shy about asking questions if you start reading any of these books. 5. Which development environment? -- C was created so that Unix could be written in it. Thus, Unix is like a giant IDE tailored specifically to C. There is no better place to get started when learning C. Of course, Windows was written in C, too, as were many other OSes/programs, but nothing embodies the spirit of C like Unix does since they were written by the same person. You could, for example, simply create an account on one of my Unix servers so you can login from home and use it as a practice space. Or I could setup a VM for you to run under some free VM software (e.g. Virtualbox) on your Windows computer at home. If I spent an evening showing you a few things, I think you would be comfortable enough to get started writing C software in Unix (and I would be happy to show you). 6. Manage your expectations -- It's difficult, when starting out in programming, to understand why one program might be difficult to write whereas another is easy to write. For example, printing "hello world" to the console is simple in C but rendering it on-screen graphically is complicated. While C tends to feel like it targets a very raw type of interaction with the computer, this is what makes it so powerful, and there will come a point in your learning where you have enough knowledge/tools, and complex tasks suddenly start to make sense, like you understand how to decompose them into the more raw operations provided by C. Until that point, it can be frustrating to see things that might be easy in other languages yet seem difficult in C. Don't get discouraged. If you dig deep enough, almost everything in written in C, even stuff that was later rewritten in other languages. For example, Python, Windows, MS Office, Firefox were all written in C. So don't get discouraged by the somewhat 'toylike' examples the programming books will have you do as practice. They're just for learning and once you know the language you can do anything.