Hacker News new | past | comments | ask | show | jobs | submit login

IMHO you're not an experienced programmer, but there will always be someone below you on the stack, so I should shut my loud mouth before someone puts my words in it.

To your request, this is not a good place to start. By the table of contents, it appears to assume a working knowledge of C.

Here are some ideas you can use to design your own "teach me C" course.

Read K&R, and write some simple toys. Write your own "cp". Handle some errors, add some options. Try out fread(3)/fwrite(3), then try read(2)/write(2).

Then write "mv" and do the same. Now make it fast within a filesystem. Or work across filesystems (depending on your first implementation).

Then write an encryption or compression program.

Now write a simple library, make a red/black tree. Store ints first, but then later, store generic objects (design your API carefully!). Make two iterators, one using a callback and one using a next() function. Decide which you like better.

About now you may start to find your development environment lacking, do you use Make? Autotools? Something else? Go learn one and update your old projects to use it. While you're at it, write some tests for them. Did you handle command line options for your version of "cp"? Did you use getopt_long(3)? Might be a good idea. Oh by the way, does it support "-R"? Hmm...and your tree isn't reentrant either, better go learn about pthread locks.

After a while, you should start learning some other libraries (because you want to do real work): curl, libxml, sqlite (hey these are in that book!). Study their code, their build systems, their test harnesses (oh man, especially sqlite's) and incorporate the ideas you like into your own work. Use them to build something cool, maybe a web crawler or whatever.

Do you like music? Learn an audio library and make something. From here, you should direct yourself to what you like building, because you probably have enough tools to do the learning on your own.

HTH




    Read K&R, and write some simple toys.
The comp.lang.c FAQ was very helpful when I taught myself C using K&R. It answered most of the questions that I had that I couldn't answer with K&R alone. I ended up reading the FAQ straight through because it was so helpful.

http://c-faq.com/


Oh most definitely. Can't believe I forgot it.


Thanks for the list.

> IMHO you're not an experienced programmer.

What prompted you to write this? I'm not insulted. I am curious why you would leap to that conclusion. Is it based on how I worded my question? Or the fact I haven't "learned" or used c? Do you think I don't understand or haven't used pointers? Or memory management issues?


It's that you haven't used C. Learning C teaches you something about programming that other languages can't. It teaches you ways of thinking about problems that are useful even when you aren't using C.

This is true of most languages, and probably most true of Lisps and MLs. If you've never learned a Lisp, I also would consider you "not an experienced programmer". Not "an inexperienced programmer", and you may be "an experienced <ruby/python/garfunkel> programmer", but I think you are "not an experienced programmer". You should also use Perl at some point, for example. By the way, it's awesome that you want to learn more, that's a very good sign. (Again, this is all very heavy IMHO ;-)

In C's case, some of the things you learn are pointers, memory management, portability, simplicity, filesystems, build systems, etc. These are usually things that are handled by other languages, or that other languages discourage you from thinking about. Other languages will have made choices for you about how to hide these details, and it's often useful to have made your own choices about such problems at least a few times in the past. Otherwise you may end up blinded by the choices made by others.


"It teaches you ways of thinking about problems that are useful even when you aren't using C."

That's a strange thing to say considering that, as a C programmer, you're much more concerned with implementation issues rather than expressing high level ideas. In general, when I'm given a problem, I care about the organization of my data. I'm not concerned with memory management.


That's a bold and narrow claim to make. How do you know with what I'm concerned? It sounds like you consider the organization of your data a loftier thing to worry about than memory management. They don't sound that different to my ears, though your view of the world sounds fairly more rude. I hope you never need to be concerned with memory management, for your and your users' sakes.

If you want to play with straw men, go elsewhere. All you're doing here is wasting everyone's time, including your own.


When you build an abstraction correctly, the things you manipulate become more meaningful. That's the point.

I'm not sure why you're getting defensive.

And I guess "organization of my data" was a bad example.


I have a strongly negative reaction to straw man arguments.

Maybe I can be more helpful:

Being a programmer is like being a novelist. You need to be able to construct a plot, but you also need a powerful vocabulary. I'm saying C helps develop your computer vocabulary, and you're saying the programming analog of "but it doesn't tell you how to invent interesting characters!" Totally different parts of a useful experience.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

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

Search: