

Deconstructing ~K&R C~ - genieyclo
http://c.learncodethehardway.org/book/learn-c-the-hard-waych55.html#x61-25200055

======
phren0logy
I didn't grow up with K&R, so I'd be very interested to hear reactions from
the crowd here who did.

~~~
ExpiredLink
Just wait for 55.2.

------
derleth
So... K&R is wrong because if people misuse its fragments copy-and-paste style
they could be dangerous.

OK. Fair enough. But tell me... why are such people coding in C now?

~~~
cbs
>why are such people coding in C now?

Everyone who learns C starts somewhere, and its not like people don't have to
learn C anymore.

~~~
derleth
My point is that mindless copy-and-paste should be limited to when you're
learning your first language. C is not a very good first language and at this
point I doubt it's a very common one.

~~~
cbs
_C is not a very good first language and at this point I doubt it's a very
common one._

There are many people for whom C is a first language, especially those in
electrical or mechanical disciplines whose introduction to programming
involves microcontrollers. The number of people learning C not as a first
language but still early on in their education is non-trivial too. Even people
who have been programming a while will have some trouble with the concepts of
pointers and null terminated strings which they likely haven't encountered
before C and they do resort back to grabbing code.

Even when someone is past the point of copy and paste, they expect learning
materials to be examples of the 'right' way to do something in an environment
that is new to them. I've been programming for ages and am learning erlang
right now, to a large extent I rely on the learning materiel I'm using to show
me the time-tested solution to problems that have been solved over and over
again for that language. Not because I couldn't do it my way, but because I'm
building in a new environment where I don't know all the ropes and expect
learning material to guide me. After all, thats what its for.

Lets look at this from the other side. Lets say someone has been programming C
for decades, but has never used a SQL RDBMS. Now he's learning PHP to make
himself a website. Is it fine for php guides to rely on his experience as a
programmer and just use some shitty hacked together SQL escaper, or should the
guides use the baked-in sanitation utility is?

