Hacker News new | past | comments | ask | show | jobs | submit login
Ask HN: Where to go to learn Modern C?
13 points by ghrifter on Jan 15, 2016 | hide | past | favorite | 8 comments
I am very comfortable in high level languages (C# for example), but would like to learn more C or C++.

Should I even bother with C? I'm planning to be a full stack web dev for at least the start of my career.

Where should I start? Preferably free resources would be nice, although I'm sure my library has most of the books that could be recommended.

Should I just kind of start on this list and go from there?

http://stackoverflow.com/questions/562303/the-definitive-c-book-guide-and-list




I've been writing C on and off for 27 years or so and I still enjoyed this book from the list on your stackoverflow link:

21st Century C - Ben Klemens http://www.amazon.com/dp/1449327141/?tag=stackoverfl08-20

You asked about "Modern C" and that caught my eye. Most instructional resources on C focus on facts about C without putting them into perspective as to which C era they belong to. "21st Century C" takes an explicitly modern perspective, is opinionated as to which aspects of C you can postpone or ignore, and provides updates for people (like me) who have mostly been familiar with K&R or C89. I found it a really fun read and would definitely recommend it as #1 for your question about "Modern C".

As to if you should learn C, I am super opinionated but I think C still has a lot of value, even for someone who doesn't describe themselves as "full-stack". The reasons are obvious: the kernel is written in C, libc is written in C, the webserver serving your web application is almost definitely written in C, but if it isn't, the compiler that compiles the language it is written in is almost definitely written in C (hats off to Golang for getting off their C compiler). Despite its flaws, I love C.


K&R is an easy read and it will give you the basics if you want to go further. Just realize that modern production C is different and don't copy-paste this code into real things (they are glossing over a lot of details -- especially with regards to safety).

Next, I'd try "C the Hard Way" which is just as beginner, but is an attempt to make C programs safer (and expose you to some of the glossed over details)


I've heard a few bad things about "Learn C the Hard Way", but I have heard good things about K&R so I'm gonna see if that book is at my library (it absolutely should be).

Another idea I had was maybe to just program in Rust. I'm not sure :)


It's really a shame that this book gets a bad rap. It's mostly because of a chapter it used to have critiquing K&R (which I thought made a good point) and possibly the online persona of the author (again, I don't agree, but I can see why others might have a problem)

In any case -- it's a great book for beginners, freely available online, and you'll know in 5 minutes whether you like the style or not.


I am, by no means, an expert in C, actually I'm a beginner. When I started reading K&R I was aware of the time it was written and how it follows certain premises. When I saw several arguments with Zed Shaw going on here, most of the time I've got the image of someone that wouldn't like to accept he was wrong in some ways. I'm not trying to take the value out of his work, I think Learn C The Hard Way is a great way to learn C, but as you said, his online persona didn't help much.


K&R is definitely not 'modern C'.

I recommend "C Programming: A Modern Approach" by K. N. King combined with "21st Century C" recommended already.



learning C the hard way is good. stay away from udemy for many reasons. they have been trending here with many bad news recently and are shady




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: