Friday, September 24, 2010

bad example

K&R uses too many super complicated examples. Too many shortcuts in the code, and too many little tricks to keep it shorter. Plus none of the examples are immediately functional - it's just snippets.

I'm chugging along in the strings/pointers chapter and it has an obtuse example program of how to sort lines in text with an array of pointers that I barely can follow. Now I'm at the part about function pointers, and it decides to rewrite the obtuse example to use function pointers! Not helpful!

So for this particular thing I need to either find another source of information - OR - I need to just start a few subsections back and actually learn what the obtuse program is doing. That itself would kill a weekend. I dunno, I'll have to think on this. I have yet to be sorry that I went back and really dug into something in this book, but I don't have 12 hours of uninterrupted time in the near future to dig in.

1 comment:

  1. If you can post the obtuse program maybe I can annotate it for you to save you some time?

    ReplyDelete