Hacker News new | ask | show | jobs
by efnysien 4807 days ago
While not straightforward or easy (for an average chap), it's quite possible, and very useful. Although I wouldn't call it most people's programming language of choice, knowing, and being able to grapple with how C pushes memory management to user-code will definitely change the way you think about programming.

TLDR : Pick up any of the hundreds of books on it and start learning! If you're having trouble motivating yourself, try solving Competition Programming problems in it - it's usually a good way to learn a new language.

2 comments

K&R was the first and only book about C that actually worked for me. Everything else was verbose, confusing, and left me with no more than the ability to do basic character apps. I read dozens of the "hundreds of books on it", and they all left me incompetent at C. K&R allowed me to become useful in the C language, including hacking on kernel modules.

I'm sure there are other good books on C. But, I never found one. They were all too long, and hid understanding behind verbosity.

K&R also made C fun for me, revealing it's nature as a well-crafted tool. Reading a lot of real C code also helped...I finally really learned C soon after migrating to Linux, where code for everything was available.

I'd go even further: I would say that K&R is the best written book in all of computer science.

It is so brief, yet it covers everything about C, introduces you to programming and to UNIX, and teaches you style. It's written by no less than the guy who coined the term "UNIX" (the K in K&R) and the inventor of C (the R). The original K&R--not including the reference manual at the end--was only 177 pages. The updated ANSI C version, 189 pages.

The opposite is any book about Java. The usual university-level Java books are a sickening 1000+ pages.

I've often wondered how anyone who's trying to learn something new can prefer a thick book over a thin one. I deliberately look for thin books -- but most people must fall for the thick==better notion.

Someone needs to write "c for ruby programmers"
Not exactly what you're looking for, but "Learn C The Hard Way"[0] isn't a bad tutorial...

[0] http://c.learncodethehardway.org/book/

> "c for ruby programmers"

Most, if not all, of this book would be "How To Use Pointers" with large sections on how to structure your code around correctly allocating and freeing memory.

A (fairly brief) appendix would be "Weird Stuff C Programmers Actually Do", for the 'dark corners' stuff that's actually used outside obfuscated code competitions. It might be hard for someone who's actually a C programmer to write this; things stop looking weird after a while.