[H-GEN] The perennial book thread

Jason Parker-Burlingham jasonp at panix.com
Thu Oct 30 12:03:37 EST 2003


[ Humbug *General* list - semi-serious discussions about Humbug and     ]
[ Unix-related topics. Posts from non-subscribed addresses will vanish. ]

Greg Black <gjb at gbch.net> writes:

> On 2003-10-29, Jason Parker-Burlingham wrote:
>> I picked up a well-worn copy of "Software Tools" by Kernighan and
>> others a few weeks ago (at the Ithaca library book sale, one of the
>> largest around) for a few bucks; when I skimmed it at the sale I
>> thought all the example programs were in C but turns out that no, it's
>> RATFOR.  Could've fooled me!
>
> ST was written in 1976, around the same time that C was being
> developed by DMR.  All those guys knew each other and there was
> a lot of cross-pollination of ideas, so it's not surprising that
> ST's language was based on C (although it's really Fortran) and
> that the tools look like Unix tools.

That's exactly why I'm now glad about having bought it; it's a nice
insight into what all these guys must have been thinking, even if the
advice isn't so revolutionary anymore.

> There's still a BSD port of Ratfor around; and I guess there's a
> Linux version too.  (Not that I'd actually use it unless I was a
> Fortran programmer.)

I'm pretty sure I remember it being an option on some early installs
of Slackware.

>> Stevens is a god.  I have the Sockets and X11 network programming
>> book, and used to have a copy of APitUE until it grew legs.  I did so
>> enjoy that book.

> Stevens is dead, sadly;

Correct, which is why I steered away from writing "living god".

> and he was definitely less godlike than usual when he wrote APitUE
> which has a significant number of plain wrong code examples.  But I
> still love the book because it's such an easy read

And that's why I think he has a claim to godliness.

This is tough stuff to write about!  I wouldn't recommend deliberately
sacrificing accuracy for readability, but sometimes all you need is a
good errata.

Your last comment about the code raises a good question:  in my early
Perl days I could write a program to do X without trouble, but it
would be hard to write, understand and maintain because I didn't know
how other Perl programmers wrote.  I was writing very idiosyncratic
code.  After I learned how to write like others do, everything started
falling into place.

The same is true for my C; because I don't know the usual way to write
in C I'm left flailing around looking for examples, trying to learn
from manual pages, and generally not having a fun time of it.

For example, I know when most of the standard library functions might
be appropriate but I'm not sure how to choose one over the other, or
how to structure loops and functions so that others---including my
future self---can look at stuff I write with a glance and see
basically what's going on.

Does anyone know of a good source of C coding examples to draw on?  It
doesn't necessarily have to be a guide or book built to learn from; a
decent collection of medium-sized programs that are written how good
programmers write will do the trick.

jason
-- 
Baby Pictures:
      http://panix.com/~jasonp?HenryGrosvenorParkerBurlingham

--
* This is list (humbug) general handled by majordomo at lists.humbug.org.au .
* Postings to this list are only accepted from subscribed addresses of
* lists 'general' or 'general-post'.  See http://www.humbug.org.au/



More information about the General mailing list