Live data from Hacker News

Beej's Guide to C Programming (2007)

beej.us

11–20 of 81 posts

Re: Beej's Guide to C Programming (2007)

#12
post #6

I like the style. It's somewhat reminiscent of _why's Poignant Guide to Ruby. (I wouldn't be surprised if the inspiration were actually in the reverse direction.)

BeeJ has been around for longer than why

It would have been nice if they could have collaborated together. "Freelance professors" that could write code and illustrate it w/ words and graphics.

Re: Beej's Guide to C Programming (2007)

#13
post #2

Beej's Guide to Network programming ( http://beej.us/guide/bgnet/ ) is also pretty good. It was effectively used as the textbook in my networking class. (There was also an actual textbook, but almost nobody bothered to read it.)

It's definitely worth reading, but be aware that it's quite old-fashioned in that it focuses entirely on blocking I/O and select(). Also this page fails to explain why you would call shutdown(): http://beej.us/guide/bgnet/output/html/multipage/shutdownman...

Thanks for pointing this out.

Re: Beej's Guide to C Programming (2007)

#16
post #2

Beej's Guide to Network programming ( http://beej.us/guide/bgnet/ ) is also pretty good. It was effectively used as the textbook in my networking class. (There was also an actual textbook, but almost nobody bothered to read it.)

I've seen this suggested in many reddit or other websites threads. Also in college classes yes.

Used it to implement ICMP echo heh.

Re: Beej's Guide to C Programming (2007)

#17
post #2

Beej's Guide to Network programming ( http://beej.us/guide/bgnet/ ) is also pretty good. It was effectively used as the textbook in my networking class. (There was also an actual textbook, but almost nobody bothered to read it.)

Beej's guides are the best way to get started quickly (i.e. in the time frame of a university course). For a more thorough introduction, one should probably read "Advanced Programming in the UNIX Environment" and "UNIX Network Programming", both from Richard Stevens.

Jens Gustedt has also written a rather nice ebook on how to program in modern C: https://gustedt.wordpress.com/2016/11/25/modern-c-is-now-fea...

Re: Beej's Guide to C Programming (2007)

#20
Very good.

A pet peeve is that it consistently says "sizeof()", like this:

You can use the sizeof() operator to determine how many bytes of memory a certain type uses. (I know, sizeof() looks more like a function than an operator, but there we are.)

BUT: sizeof does not in fact need the parentheses always!

Syntactically they are part of the argument, and only needed when the argument is a type name, i.e. the argument looks like a cast to that type.

So:

    int x;
    printf("%zu == %zu\n", sizeof x, sizeof (int));
It's very annoying to see the guide kind of glance off the way things really are, into confusion.

Very glad to see it doesn't cast the return value of malloc(), too. :)

Post reply on HN