Relearning modern C

Over the past few weeks I’ve started relearning the C programming language, which I haven’t used much since my undergraduate degree. Apart from the intellectual challenge, there’s a lot of C code out there that needs to be maintained, updated etc. and fewer people able or willing to do this. Given that one of my specialisms is legacy code, relearning C seems like a sensible choice from a commercial standpoint.

I prefer to learn languages from a book, as I find this is the best way to get a wide understanding of a topic. Tutorials can be useful for specific tasks (e.g. how do I create a linked list) but they rarely cover how everything fits together. There is a shortage of good, up to date books on C – the ones I own at the moment are:

The C Programming Language: Sometimes referred to as ‘K&R’, this was written in the 1970s by two people involved in the original development of C. There is no coverage of later revisions such as C99 and C11, and some of the examples are no longer considered good practice, but it’s still a clear and accessible starting point.

Practical C Programming: Usually I’m a fan of the O’Reilly animal books, but this one feels a bit outdated, rather like K&R except not as succinct.

C Programming: A Modern Approach: A hefty tome which goes into a lot of detail on most topics. The only downside is that it is intended as a university textbook, and so the author will only provide examples to around a third of the exercises. C99 is covered, but not C11.

C in a Nutshell: Superb reference and covers everything up to C11. Not intended as an introductory text.

21st Century C: Covers the ecosystem (e.g. applications for building C projects) and some advanced topics. The author has some strong opinions, not all of which I agree with.

Learn C the Hard Way: Another author with strong opinions, who thinks that the best way to learn C is to spend most of your time debugging deliberate errors. I’m not entirely convinced of this approach.

I’m also using Project Euler as a list of problems to solve, as opposed to the rather basic examples found in books.

My ultimate goal, other than being able to take on freelance work in C, is to be able to find and fix some of the many bugs in open source projects which are still using C, or contribute to the Linux kernel. I suspect it will be some time before I have reached that level of proficiency though.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.