:: Re: [DNG] Learning C
Αρχική Σελίδα
Delete this message
Reply to this message
Συντάκτης: Vince Mulhollon
Ημερομηνία:  
Προς: dng
Αντικείμενο: Re: [DNG] Learning C
On Fri, Sep 27, 2024 at 11:42 AM Peter Duffy <peter@???> wrote:
> van der Linden, Peter: Expert C Programming (Deep C secrets) (Prentice
> Hall) (title of one section: "Bus error, take the train")


I'd second that, great book.

Learning C from K+R works, but I'd propose that post 2020 C is best learned from

Gustedt, "Modern C" (Manning)

My one line review of Modern C is its very broad, covering new
programmers to old timers, and arguably too short given the wide
breadth. Then again, if you want to get into threads specifically,
maybe a 20 page intro is just right.

See also:

Klemens, "21st century C" (Oreilly)

My one line review of 21st Century C is its not as good as Modern C
for a newbie but pretty good if you've been around the block a few
times since 1990.

C programmers are, or used to be, pretty resilient. I learned on
Microware OS-9 which had a K+R compiler not ANSI, definitely not ANSI.
A bit of a culture shock hitting ANSI on linux after using Microware's
compiler. Wait, wait, you guys set the parameter types in your
function prototypes, like what? I got used to it eventually. My
point being that the old K+R dogs learned new ANSI tricks a generation
or two ago (I wuz there) and the old guys now will also learn the new
tricks.

The problem with learning C as an archeological process from old books
to new, is you'll also have to learn ALL the security issues,
perfectly, probably the hard way, of why they invented srtncpy and
people don't use strcpy that much anymore. From memory K+R (at least
old editions, even the ANSI edition of K+R) used strcpy in example
code, so the usual monkey see - monkey do WILL happen and next thing
you know the noob programmer is discovering the CVE process LOL. Well
if K+R does it, it can't be bad, correct?