What little I know about C

jdavidb on 2008-01-25T16:35:27

Schwern's recent call for a "C for Perl programmers" tutorial was interesting to me. I consider myself to be capable as a C programmer, in that I did learn the language and wrote quite a bit of C in school (and sometimes in other places, like on the job). But there's a lot of heavy wizardry I can't do, or learned how to do once but never did regularly.

I loved Dave Rolsky's list of what it takes to really know C. I've been peripherally aware of those things through the years, sometimes even learning the specifics, but I've just never done them regularly. Dave and Schwern are right: there's not a good place to learn all of this stuff.

So, I thought I'd provide links to places where I think I learned some of it once, long ago. Before I decided I never wanted to do C again.

First off is The GNU Project Coding Standards. Reading this was annoying in places, since I knew I would never do things the way they did. But sometimes it was enlightening. I learned how to use pointers to opaque data structures, which the standard recommended to avoid having implementations break on upgrade when the underlying structures changed. It was simultaneously ugly and beautiful. By then I was firmly in the Perl camp, but still having to do C for graduate work, and I spent a semester in a graduate algorithms class (which was almost identical to my undergrad algorithms class) practicing doing everything in opaque C structures. With automated test suites. I imagine the grad student teaching the class wondered what I was smoking. But I learned a lot.

Another source was the GNU autotools book, though now I can't remember what all was in there, and what I picked up elsewhere. But as Dave Rolsky said, configuration probing seems to be an integral part of all F/OSS work in C.

Finally, the old O'Reilly Lion book helped me a lot; the one which documented UNIX systems calls. The lion graphic has now been recycled for some Java book, and there is no O'Reilly UNIX systems calls book; I've found the GNU glibc docs to be pretty useful, though, and occasionally very educational.


Found this searching one day...

sigzero on 2008-01-25T19:06:02

http://www.faqs.org/docs/learnc/