Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!tut.cis.ohio-state.edu!bloom-beacon!adam.pika.mit.edu!scs From: scs@adam.pika.mit.edu (Steve Summit) Newsgroups: comp.lang.c Subject: Re: Wanted: advice on a good C textbook Message-ID: <12688@bloom-beacon.MIT.EDU> Date: 15 Jul 89 02:12:40 GMT References: <2790@ssc-vax.UUCP> <5005@ficc.uu.net> <1900@prune.bbn.com> Sender: daemon@bloom-beacon.MIT.EDU Reply-To: scs@adam.pika.mit.edu (Steve Summit) Lines: 30 In article <1900@prune.bbn.com> rsalz@bbn.com (Rich Salz) writes: >>I *highly* recommend _The C Puzzle Book_. > >Ick. I highly disrecommend this book. It teaches you to debug code that >only a psychopath would write, and warps you into looking for things that >are almost never there. Stay as far away from such code as possible! I'll emphatically second Rich's motion. The more subtle problem is that computer languages are learned in part by imitation, just as are natural ones. One reason that so many people write horrid code is because that's all they saw when they were learning. The C Puzzle Book is chock-full of code that people should neither have to know how to understand or to write. "But wait," you say, "surely, having seen how hard to understand ugly code is, one would be inclined to shun it in one's own work." 'Fraid not. For one thing, since there's so little good code around, people figure that, as ugly as ugly code is, it's just a necessary part of computer programming. Then there's the "macho" attitude -- "I can understand this glop now, so I'll impress everyone with my erudition by writing some for myself." (I have talked to intermediate programmers who believed that they should start writing more cryptic code in order to be "advanced.") Finally, there's all sorts of paradoxical human psychology involved -- people are often drawn to that which they dread, especially if it's all they know. (Read Poe's "The Imp of the Perverse" sometime.) Steve Summit scs@adam.pika.mit.edu