
Learn C the hard way
by Zed Shaw · first published 2015
157mentions
70recommended by
140HN commenters
2010–2025first – last mentioned
49% recommend38% neutral13% critical
Why HN recommends it
Hands-on, exercise-driven start for beginners that teaches real-world C practice early: compiler warnings, makefiles, Valgrind, debuggers and defensive programming. Suits self-taught programmers moving to systems code.
Summarised by Claude from recommending comments
Affiliate links. As an Amazon Associate I earn from qualifying purchases.







…anything useful in C is with a) pointers and b) memory management which this guide doesn't seem to cover. From my experience, the best way for learning C has been [0] Build Your Own Lisp and Zed Shaw's [1] Learn C The Hard Way. That and of course spending countless hours debugging segfaults and memory leaks. [0] - http://www.buildyourownlisp.com/ [1] - https://learncodethehardway.org/c/
on “C for Python programmers (2011)” ↗…bad, every language should have higher-order functions, yadda yadda. I finally decided to get a deeper knowledge of C, something I've been saying I "should do" for years. I'm learning it via Zed Shaw's Learn C The Hard Way and I'm very impressed by the language. It does what it does very well. I wouldn't use it for a complex web app, but it's a fine language for things that are small but in which quality (which includes…
on “The Unreasonable Effectiveness of C” ↗I would recommend "Learn C the Hard Way" by Zed Shaw to get you started for something practical, because it goes over how C is written in the real world. Of course, situations will vary. The original book about C by K&R is an excellent book…
on “Ask HN: How do I learn C properly?” ↗Zed Shaw's "Learn C the hard way". Had years of scientific programming before that (R, Matlab). But I used to be afraid of working with "real" code bases. This book (which still has an unfinished feel to it) helped me understand how…
on “Ask HN: What book changed your life?” ↗As long as they're local I guess, like a handmade `finally` clause. It's like mutation in functional programming languages, they're allowed as long as they don't leak. IIRC Zed Shaw's Learn C the Hard Way has some nice `goto` examples..
on “If goto statements are bad why does linux src have more than 10k of them?” ↗Zed Shaw's "Learn C the Hard Way" is a rather good intro to C for systems programming.
on “What are must read books for entry level C programmer?” ↗…wholeheartedly agree with this! I am a pretty inexperienced self-taught frontend developer currently trying to learn Haskell and C. I went through Learn You A Haskell and have started going through Zed Shaw's Learn C The Hard Way. On the surface, LYAH looks a lot more polished. It has nice drawings, less typos, seems like an actual book rather than a gathering of notes and thoughts turned into teaching material. But the exercises…
on “Learning Rust” ↗I really enjoyed "Learn C The Hard Way" by Zed Shaw. His style of learning resonates with me. https://learncodethehardway.org/c/
on “Ask HN: Best book to learn C in 2022?” ↗I agree with x1 that you should start with whatever will keep you going. If the command line appeals to you, check out Zed Shaw's "Learn C the Hard Way." It is not at all sans dev tools, but it will have you using sophisticated CLI tools rather than a GUI. I have found it to be a good fit for me personally, and I suspect I'm not alone.
on “Using unix as your IDE” ↗I've enjoyed working through Zed Shaw's "Learn C the Hard Way" as a way of refreshing my C skills; while I can't vouch for this method's effectiveness for beginning programmers, it's been great for me to re-familiarize myself with a language I haven't touched in…
on “Ask HN: Equivalent of "Learn X the Hard Way" for Javascript?” ↗I'm surprised no-one's mentioned it yet, but this approach should go well with Zed Shaw's Learn C the Hard Way: http://c.learncodethehardway.org/book/
on “Where to begin when learning C? Start by making lots of errors” ↗Learn C The Hard Way is more like opinionated tutorials not a textbook. It's great for someone just getting started. If I were to hand someone K&R - The C Programming Language, their interest would instantly vanish. Why not…
on “Don't Learn C the Wrong Way” ↗If I ever get around to going back to learning C my two starting resources would be: Zed Shaw's Learn C the Hard Way because one weekend a couple of years ago and back when it was free online, I started working through it and it's very good for a beginner...which is Shaw's goal. The reason it's good for a beginner is…
on “Ask HN: How should I go about learning C?” ↗It's a fairly controversial pick amongst the C community, and it is a full book, but the first few chapters of 'Learn C the Hard Way' by Zed Shaw are (imo) a great resource to get started with the language, and also point you towards tools like Valgrind which you might not come across otherwise.
on “Getting started with C” ↗This is one of the tips given in Zed Shaw's "Learn C The Hard Way". I've also found it invaluable, and make my mentees do the same thing.
on ““The Suck” (Learning Anything by Writing It Out by Hand)” ↗