Learning C as a (relatively) experienced programmer?



I have a computer science degree from which I learned Java, Scala, a bit of Python and other high level languages, but no low-level languages such as C. I’ve had jobs working in Java, and for the past year have had a job writing Python. I also have a bit of experienced with functional programming and logic programming.

I’d like to learn some C, partly out of curiosity, partly out of the history of it, partly to learn any insights that high level languages don’t offer, partly so I might be able to contribute to a project in C at some point if I get interested in one.

What approaches to learning C would you recommend to someone in my position?


I learned C (a very long time ago, to be sure) by reading Kernighan and Ritchie (https://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628) and doing the problems. I don’t think there is a better way to do it - a decent programmer should likely speed through the early problems and so get to the more advanced stuff (like pointers) quickly.


I have to second that book. It’s great.


For exercise, I would suggest doing a lot of string parsing, splitting, etc. in C. That was something that tripped me up a long time ago when I was first learning, and more recently saw that trip up lots of people in a class I was taking. That included even some people experienced with Java and other languages.

It will help grasp things like pointers and memory allocation, as well as make you appreciate languages that do this for you :slight_smile:


I’ve been a big fan of Zed Shaw for a while and really enjoyed Learn C The Hard Way.


OOh and the other plus of any of the Learn Code The Hard Way series is that it’s easy for people who have the experience to learn the basic of the language fairly quickly.


Strongly agree with this comment!

I failed my first heavy string parsing project in my first C class (operating systems) in college, dropped the class and took an intro course that moved slower. By the time I retook operating systems and did the project the second time, I was much better prepared for how to deal with strings when I had to manage their memory myself!


In addition to K&R2, you may find the book “Expert C Programming: Deep C Secrets” interesting (ISBN: 978-0131774292).

It was written by Peter van der Linden who used to be with Sun. You may find your Java background resonating here!

The book is very well-written and is fun to read. It has all the three elements you look for: insights, history, and fun stuff that will satisfy your curiosity.


I can recommend Learn C the Hard Way, it teaches you C but also shows what’s going on under the hood of the programs you’ve written too.


Try out CS50


  • has small projects
  • comes with lectures and short clips
  • large community of students to chat with
  • free


+1 to this book, and your recommendation of it!

I feel like Deep C Secrets is a really under-appreciated book. It’s full of fun anecdotes, enlightening explanations of how things work, and really good advice on how to avoid common problems!


I can also recommend 21st Century C as a second book. There have been advances since K&R, especially in the C ecosystem, and learning about that will make your life easier.

There are a lot of common tasks like writing web apps, consuming web apps, and xml parsing that other languages have more visibility in their ecosystem. C has the tools as well, and they’re typically easier to use, especially when you hit edge cases.


“A Course on C” was the standard first-year text on my CS course - but also the most-borrowed book on my desk once I went into industry writing C full-time! Given the high quality of my workmates, that’s a ringing endorsement :slight_smile: