Live data from Hacker News

Beej’s Guide to C Programming [pdf]

beej.us

111–120 of 178 posts

Re: Beej’s Guide to C Programming [pdf]

#111
I love Beej’s guide to network programming. Back when I was just starting to learn to code, I wanted to get right down to the low level C stuff and his guide was what I used. It was simple and approachable and I had a running TCP client by the end of the day. It was a thrilling experience for a young novice.

Re: Beej’s Guide to C Programming [pdf]

#112
post #7

I've enjoyed this guide a number of times but each time I hit a brick wall trying to understand pointers. I'm still keen to learn but it just doesnt 'click' for me... Edit: poor grammar

around 25 years ago I got so frustrated because I hit the same brick walls over and over especially with advanced pointer stuff. It sounds silly today but what helped me are some really basic books about C. iirc the "for dummies" series and others. It took another couple of years until I understood what I lacked wasn't time spent reading another section on pointers but additional tooling. Using a debugger and steppin…

Ability to inspect is vital indeed

Re: Beej’s Guide to C Programming [pdf]

#113
post #7

I've enjoyed this guide a number of times but each time I hit a brick wall trying to understand pointers. I'm still keen to learn but it just doesnt 'click' for me... Edit: poor grammar

Just learn C by reading and working through the K&R book. (It's one of the best CS books ever written.) https://www.amazon.com/Programming-Language-2nd-Brian-Kernig... Also, there's nothing magical about pointers - scripting languages use "handles", which is the same thing except they're read-only to the end-user programmer. The real challenge with C is multi-threaded programming, so don't do that if you don't need i…

I agree. If you're only going to read one book, that's the book. :-)

Re: Beej’s Guide to C Programming [pdf]

#114
post #16
post #6

IMO, pointers are less difficult to comprehend than other abstractions, like lambdas are. If you know how to walk down a street and stop at the right street number, then you have used pointers. And if you've ever observed that one tall building may "cover" a range of street numbers, such as 200-220, then you should understand how to move from one 4-byte "value" to the next in an array in memory. Anyway, many more ana…

What's difficult to understand about pointers isn't the concept of a pointer itself, or even * and &, it's the fact that working with pointers requires you to simultaneously understand different abstraction levels. While it's not unique to pointers, and it's in fact the case for most nontrivial programming tasks, what's unique about C is that pointers are so pervasive you can't really do anything if you don't underst…

People that can’t comprehend arrays/lists in Python, especially multi-dimensional ones, would have had no chance in C

Re: Beej’s Guide to C Programming [pdf]

#115

it actually has working examples for all of the C library calls even math routines. Not sure if it's complete but it seems so. This seriously helps bridging the gap between man (2) pages and putting things into working code and only beef I have is that I didn't have it 25 years ago. Very cool.

It's not complete... There are tons of functions in C11+. I'm whittling it away.

Putting in the examples for all the calls--I stole that idea from The Turbo C Bible, a book I really loved back in the day... because of the examples.

Re: Beej’s Guide to C Programming [pdf]

#116

There was a "C Unleashed" book, a massive tome of 1000+ pages written by many famous programmers, many of them who where quite active in comp.lang.c, like Richard Heathfield and CB Falconer, had quite insightful material in it. Any one remember the heyday of comp.lang.c? I wonder what goes on in there now.

I wasn't sure anyone but the authors remembered C Unleashed! I wrote the chapter on binary search trees and balanced trees.

Comp.lang.c was important to me for many years. I've met 5 or so of the regulars at least once. The most famous comp.lang.c regular is probably Tim Hockin of the Kubernetes project.

Re: Beej’s Guide to C Programming [pdf]

#117

Again, the string chapter is telling us about zero-terminated char arrays/pointers and doesn't even mention Unicode/UTF-8 or safety :-(

I do have a chapter on Unicode and wide characters, but it's separate from the "classic" strings chapter. That said, I could certainly refer forward to it.

And C11 only has minimal portable UTF-8 support, but I do talk about it. I think C21 will improve on that a bit.

A note on safety would be well worth it. I'll do that. Good suggestion.

Re: Beej’s Guide to C Programming [pdf]

#118

There was a "C Unleashed" book, a massive tome of 1000+ pages written by many famous programmers, many of them who where quite active in comp.lang.c, like Richard Heathfield and CB Falconer, had quite insightful material in it. Any one remember the heyday of comp.lang.c? I wonder what goes on in there now.

I wasn't sure anyone but the authors remembered C Unleashed! I wrote the chapter on binary search trees and balanced trees. Comp.lang.c was important to me for many years. I've met 5 or so of the regulars at least once. The most famous comp.lang.c regular is probably Tim Hockin of the Kubernetes project.

Thanks very much! The code from the book proved very useful since C does not have a standard library of rich data structures.

Re: Beej’s Guide to C Programming [pdf]

#119

Earlier quoted context omitted.

What does "modern" C imply? AFAIK, there are not very many new language features; is it about organizing code differently than what one would learn from K&R?

C99 I would imagine: https://en.wikipedia.org/wiki/C99

The current standard is C17, of course: https://en.m.wikipedia.org/wiki/C17_(C_standard_revision).

Re: Beej’s Guide to C Programming [pdf]

#120
post #86

Earlier quoted context omitted.

I think posts like this are handy just for the extra exposure an alpha document might need; there's a lot of good feedback and discussion here that hopefully beej comes across someday and can finish the book

On further observation the git repository of the book [0] seems to be quite active. Maybe this book might be finished after all. [0]: https://github.com/beejjorgensen/bgc

Backstory: I started writing this book for novice programmers about 15 years ago. It was going to be a lot shorter.

But I became disinterested because:

1. Most beginning programmers don't start with C

2. I wouldn't get a chance to go deep and explore the language.

So I shelved it, unfinished.

Flash forward to about a year ago... I had flash of inspiration: change the audience to intermediate programmers.

Now I could skim the general conceptual stuff and get into more details.

One thing, though. C actually added a lot of stuff in the intervening years. I didn't realize the magnitude of the project.

Oh well! Too late to turn back now!

Post reply on HN