A recent rediscovery... 
Author Message
 A recent rediscovery...

I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
just skimming it, mostly out of curiousity.  I was delighted to discover
that I *still* can't find errors in it.

I must take this opportunity to recommend that anyone having trouble
understanding C grab this book.  The info:
        Koenig, Andrew
        C Traps and Pitfalls
        ISBN 0-201-17928-8

"reprinted with corrections November, 1988".  (I have a review copy too, and
haven't found any of the errors that were corrected.)

This book covers a lot less ground than, say, K&R, or the FAQ.  It covers only
*dangerous* places in C.  I don't believe I've seen more than a couple of
misconceptions about C in the last *year* that are not discussed in this book.

Interestingly, all but one of the errors I pointed out recently in Schildt's
tripe is corrected in this book.  (The one not corrected is the one where, in
the 2nd edition of C:TCR, the operator "<>" is invented to refer to comparison
for inequality.)

I just thought I'd pass on to everyone that there's a book out there which you
probably haven't read, which is probably worth reading.

Anyone got books they'd like to recommend, other than the usual?  (Everyone
*ought* to have K&R2 and the book form of the FAQ already, I don't think they
need much more harping.)

-s
--
Copyright 1997 Peter Seebach - seebs at solon.com - C/Unix Wizard

The *other* C FAQ, the hacker FAQ, et al.   http://www.*-*-*.com/ ~seebs
Unsolicited email (junk mail and ads) is unwelcome, and will be billed for.



Mon, 05 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

Quote:

> Anyone got books they'd like to recommend, other than the usual?  (Everyone
> *ought* to have K&R2 and the book form of the FAQ already, I don't think they
> need much more harping.)

If you don't mind straying from books purely about C, both of Jon
Bentley's _Programming Pearls_ books are worth rediscovering every
year or two.  He also wrote one called _Writing Efficient Programs_
which I haven't seen in print for about 10 years, but IIRC that was
pretty worthwhile as well.  (I don't own a copy of _WEP_; if anyone
knows where I can find one, I'd appreciate it.)


Thu, 08 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

Quote:

> I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
> just skimming it, mostly out of curiousity.  I was delighted to discover
> that I *still* can't find errors in it.
> I must take this opportunity to recommend that anyone having trouble
> understanding C grab this book.  The info:
>    Koenig, Andrew
>    C Traps and Pitfalls
>    ISBN 0-201-17928-8
> "reprinted with corrections November, 1988".  (I have a review copy too, and
> haven't found any of the errors that were corrected.)
> This book covers a lot less ground than, say, K&R, or the FAQ.  It covers only
> *dangerous* places in C.  I don't believe I've seen more than a couple of
> misconceptions about C in the last *year* that are not discussed in this book.
> I just thought I'd pass on to everyone that there's a book out there which you
> probably haven't read, which is probably worth reading.

I generally hate content-free posts where the respodent does nothing more
than say "Amen." So, permit me to say, "Halleleujah!".

Like his BTL colleagues, Koenig packs a lot into a little. This slim
classic has about 140 pages...every one worthwhile.

About the *only* thing I question in the least is the "Anachronisms"
section on p. 133. He states that using the precision modifer is "a
much better way" to achieve the printing of zero-padded integral values.
That may indeed be so...but I mildly object to the inclusion of the "0"
flag discussion being placed in the "Anachronism" section. (IMHO,
Koenig may have been better off treating the precision specifer in
the preceding "Neologisms" section).

Quote:
> Anyone got books they'd like to recommend, other than the usual?  (Everyone
> *ought* to have K&R2 and the book form of the FAQ already, I don't think they
> need much more harping.)

Aside from the usual suspects (K&R, CT&P, van der Linden, H&S, King and
the rest), I spent some holiday time dusting off some otherwise
forgotten/neglected books and re-reading them. Aside from its "unwarranted
chumminess with the compiler", I personally from Libes' "Obfuscated C
and Other Mysteries" (ISBN 0-471-57805-3) quite good on this second-time
around. Libes gets extra credit for naming chapter 22 "x = x++". :)

I'll also add that Libes' style is much like that of Koenig or van der
Linden...quite informal (almost chatty)...making for fun read. (His
style in "Obfuscated C" is magnitudes better than it was in his former
wooden and plodding effort (with Sandy Ressler), the ghastly "Life with
Unix". It was for that reason I consigned the latter book to a back
shelf. I'm glad I had a chance to re-discover this one!

--
=============================================================================

     linux for fun, M$ for $$$...and the NFL for what really counts!
=============================================================================



Thu, 08 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

|> I must take this opportunity to recommend that anyone having trouble
|> understanding C grab this book.  The info:
|>   Koenig, Andrew
|>   C Traps and Pitfalls
|>   ISBN 0-201-17928-8

I want to second that. Damned fine book.

|> Anyone got books they'd like to recommend, other than the usual?  (Everyone
|> *ought* to have K&R2 and the book form of the FAQ already, I don't think they
|> need much more harping.)

Plauger's _The C Standard Library_ (ISBN 0-13-131509-9) is a must. It's
such a great shopping list that helps you to not reinvent the wheel.



Thu, 08 Jul 1999 03:00:00 GMT  
 A recent rediscovery...


   > Anyone got books they'd like to recommend, other than the usual?  (Everyone
   > *ought* to have K&R2 and the book form of the FAQ already, I don't think they
   > need much more harping.)

at the risk of tooting my own horn, you might have a look at:

C Interfaces and Implementations: Techniques for Creating Reusable
Software (Addison-Wesley Professional Computing Series, 1997, ISBN
0-201-49841-3).  It advocates a design methodology based on interfaces
and their implementations, and it illustrates this methodology by
describing 24 interfaces and their implementations in detail.

see http://www.cs.princeton.edu/software/cii/ for more info.



Fri, 09 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

Quote:

>  I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
>  just skimming it, mostly out of curiousity.  I was delighted to discover
>  that I *still* can't find errors in it.

>  I must take this opportunity to recommend that anyone having trouble
>  understanding C grab this book.  The info:
>          Koenig, Andrew
>          C Traps and Pitfalls
>          ISBN 0-201-17928-8

>  Anyone got books they'd like to recommend, other than the usual?  (Everyone
>  *ought* to have K&R2 and the book form of the FAQ already, I don't think they
>  need much more harping.)

Although _not_ explicitly C, I learned a lot from Kernighan and Pike's
The UNIX Programming Environment.

I got a fair bit out of Ranade & Nash's The Elements of C Programming
Style too (thought I do _thoroughly dislike_ their chosen formatting).

C'ya,

gary           /* GIS Applications Developer */

         1996 - 97 UF GATORS - * - NATIONAL CHAMPIONS!
           -=- visit The C Programmers' Reference -=-
        http://users.southeast.net/~garyg/main_page.html



Mon, 12 Jul 1999 03:00:00 GMT  
 A recent rediscovery...


Quote:

>I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
[...]
>Anyone got books they'd like to recommend, other than the usual?  (Everyone
>*ought* to have K&R2 and the book form of the FAQ already, I don't think they
>need much more harping.)

    It's hard to know what is meant by the usual.  I think Harbison &
Steele is usual but others might not.  I have an online list of books that
I recommend for people who don't know much programming yet
<URL:http://www.csd.uwo.ca/~jamie/.Refs/tech-books.html>.  I expect that
most of the regulars here have read them all.  I also have comments about
some other books that I can recommend to people who are already damn fine
programmers.  In addition to what I have listed here I also recommend
K&R II and the FAQ book, but you already knew that.

*Everyone* should read Elements of Programming Style.  
 The Elements of Programming Style (Second edition)
   by Brian W. Kernighan and P.J. Plauger,
   published by McGraw-Hill in 1978.
   QA76.6.K47 1978

The Programming Pearls books have already been mentioned.  I include them
here to second that recommendation and include the publication details.
 Programming Pearls
   by Jon Bentley,
   published by Addison-Wesley in 1989 (with corrections).
   QA76.6.B453 1986
and
 More Programming Pearls: Confessions of a Coder
   by Jon Bentley,
   published by Addison-Wesley in 1988.
   QA76.6.B452 1988

H&S should need no introduction.
  C: A Reference Manual (Fourth edition)
   by Samuel P. Harbison and Guy L. Steele,
   published by Prentice Hall in 1995.
   QA76.73.C15H38 1995

I don't think anyone wrote about Plauger's collected columns yet.  Although
I don't like his style I think Plauger has some excellent comments about
programming and business.  I found his columns about encapsulation and
objects especially insightful, but I don't know much about that stuff so my
opinion might not be worth much.
  Programming on Purpose: Essays on Software Design
   by P. J. Plauger,
   published by PTR Prentice Hall in 1993.
   QA76.76.D47P55
and
  Programming on Purpose II: Essays on Software People
   by P. J. Plauger,
   published by PTR Prentice Hall in 1993.
   QA76.76.D47P552
and also
  Programming on Purpose III: Essays on Software Technology
   by P. J. Plauger,
   published by PTR Prentice Hall in 1994.
   QA76.76.D47P553

I had a lot of fun reading the van der Linden's book.  An argument in the
book caused me to change my programming style too.
  Expert C programming: Deep C Secrets
   by Peter van der Linden
   published by SunSoft Press in 1994
   QA76.73.C15V356 1994

I skimmed _Obfuscated C_ over a weekend last year and enjoyed it.  It
certainly isn't for beginners.
 Obfuscated C and Other Mysteries
  by Don Libes
  published by Wiley in 1993
  QA76.73.C15L53 1993

I haven't finished reading King's book yet, but I like the style a lot.
Unlike many textbooks, readers are not likely to be misled by simple but
incomplete explanations but it isn't overwhelming either.  I recommended
the book (among others) for people who are new to C and I think it might be
appropriate for programmers who just wants a refresher course.  Personally,
I found K&R II a great refresher but you might have different tastes.
 C programming: A Modern Approach
  by K. N. King
  Published by Norton in 1996
  QA76.73.C15K49 1996
--



Tue, 13 Jul 1999 03:00:00 GMT  
 A recent rediscovery...



Quote:
> Anyone got books they'd like to recommend, other than the usual?
(Everyone
> *ought* to have K&R2 and the book form of the FAQ already, I don't think
they
> need much more harping.)

I would recommend _Code Complete_ by Steve McConnell, available from MS
Press. It covers points that are important when using any language and has
examples in C, fortran, and BASIC. The book is very clearly written, and
the author backs up all of his suggestions about programming style with
solid data and logical reasons.  There were a few parts of the book where I
disagreed with his recommendations for style (i.e., how to format function
comments, etc.), but in the end he states that the most imprtant thing is
to have a consistent style and to stick with it, so that's OK :-)  

Anyone else read the book and formed any opinions on it?

Phil

"Ook"  --The Librarian



Tue, 13 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

I'd like to add another suggestion for a new C book I'm reading;
it's certainly not for pure beginners and I am having to
_work_ thru this one, but it seems like a winner.

The book is:

C Interfaces & Implementations: Techniques for
Creating Reusable Software by David R. Hanson (1997) from
Addison-Wesley.

There are some typos and a few mistakes in the first printing but
they don't detract from the overall value of this book.

There is online information about this book at:
"http://www.cs.princeton.edu/software/cii"
including Richard A. O'Keefe's c.l.c.m brief review.

<fyi: LibHiTech, "http://www.libhitech.com", had the best
price of $32.95>

For each copy you buy, I get squat! so don't let the commercial info
in this post distract you ;-)

Cheers,

gary           /* GIS Applications Developer */
       (Email): >/dev/null ? remove NoSpam before replying
           -=- visit The C Programmers' Reference -=-
        http://users.southeast.net/~garyg/C_ref/C/c.html



Wed, 14 Jul 1999 03:00:00 GMT  
 A recent rediscovery...




 >

 >    > Anyone got books they'd like to recommend, other than the usual?
(Everyone
 >    > *ought* to have K&R2 and the book form of the FAQ already, I don't
think they
 >    > need much more harping.)
 >
 > at the risk of tooting my own horn, you might have a look at:
 >
 > C Interfaces and Implementations: Techniques for Creating Reusable
 > Software (Addison-Wesley Professional Computing Series, 1997, ISBN
 > 0-201-49841-3).  It advocates a design methodology based on interfaces
 > and their implementations, and it illustrates this methodology by
 > describing 24 interfaces and their implementations in detail.
 >
 > see http://www.cs.princeton.edu/software/cii/ for more info.
 >

I bought it in my recent trip to USA.
I'm reading it right now and it looks *very* good indeed.

IMHO, I recommend it !!

        See ya, Eduardo



Wed, 14 Jul 1999 03:00:00 GMT  
 A recent rediscovery...


Quote:

>I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
>just skimming it, mostly out of curiousity.  I was delighted to discover
>that I *still* can't find errors in it.

>I must take this opportunity to recommend that anyone having trouble
>understanding C grab this book.  The info:
>    Koenig, Andrew
>    C Traps and Pitfalls
>    ISBN 0-201-17928-8
>...
>Anyone got books they'd like to recommend, other than the usual?  (Everyone
>*ought* to have K&R2 and the book form of the FAQ already, I don't think they
>need much more harping.)

Author:       Van Der Linden, Peter
Title:        Expert C Programming
Publisher:    Prentice Hall
Year:         1994
Pages:        384p.
ISBN/Price:   0-13-177429-8 Paper Text $36.00 (Ingram Price), $36.00

This book explains better than i've otherwise seen most of the nastier
mental quagmires (and the way out of them) associated with C.

It's too bad his "Official Handbook of Practical Jokes" is
out-of-print, however.

best regards,



Fri, 16 Jul 1999 03:00:00 GMT  
 A recent rediscovery...


...

Quote:
>I would recommend _Code Complete_ by Steve McConnell, available from MS
>Press. It covers points that are important when using any language and has
>examples in C, FORTRAN, and BASIC. The book is very clearly written, and
>the author backs up all of his suggestions about programming style with
>solid data and logical reasons...
>Anyone else read the book and formed any opinions on it?

>Phil


Yes, I bought it 3 years ago. It has a sensible answer or discussion for
most of the questions about programming that I have consulted it for. It
has influenced my C and Fortran programming. In the first few weeks, I
just opened it at a random page many times, and always found an
interesting argument.

The index is pretty good (30 pages) but I have added a few items of my
own, which might interest other owners of this book:
Adding numbers, 239
Analysis, 24, 29
Common coupling, 90
Data access routines, 217, 230
Formality, 518
Interactive programs, 39
Length of routines, 93
Messages, 276
Multiple operations in 1 line, 432
Size of routines, 93
Standards, having, 765

Details: Code Complete, A practical handbook of software construction,
by Steve McConnell. Pub. Microsoft Press, ISBN 1-55615-484-4
Prices (in 1994) USA $35.00, UK #29.95, Canada $44.95

Oliver



Fri, 16 Jul 1999 03:00:00 GMT  
 A recent rediscovery...


 >
 > >  I recently rediscovered a wonderful book, _C Traps and Pitfalls_.  I was
 > >  just skimming it, mostly out of curiousity.  I was delighted to discover
 > >  that I *still* can't find errors in it.
 > >  
 > >  I must take this opportunity to recommend that anyone having trouble
 > >  understanding C grab this book.  The info:
 > >          Koenig, Andrew
 > >          C Traps and Pitfalls
 > >          ISBN 0-201-17928-8
 > >  
 >
 > >  Anyone got books they'd like to recommend, other than the usual?  (Everyone
 > >  *ought* to have K&R2 and the book form of the FAQ already, I don't think they
 > >  need much more harping.)
 > >  
 > Although _not_ explicitly C, I learned a lot from Kernighan and Pike's
 > The UNIX Programming Environment.

Although explicitly NOT C, I find Kernighan and Plauger's "Programming
Tools in Pascal" excellent.  (Despite the title, and the apparent syntax
of the language used, the programs really are C, disguised to look like
Pascal.)

--

GABI Software, Sarl., 22 rue Jacques-Lemercier, 78000 Versailles, France
                          -- Conseils en informatique industrielle --



Fri, 16 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

[snip]

Quote:
>  > >  Anyone got books they'd like to recommend, other than the usual?  (Everyone
>  > >  *ought* to have K&R2 and the book form of the FAQ already, I don't think they
>  > >  need much more harping.)
[snip]
> Although explicitly NOT C, I find Kernighan and Plauger's "Programming
> Tools in Pascal" excellent.  (Despite the title, and the apparent syntax
> of the language used, the programs really are C, disguised to look like
> Pascal.)

Every programmer ought to own all three available volumes of Knuth's
_Art of Computer Programming_.  I can't say as I understand every
proof that Knuth presents, but his insight into algorithms is
invaluable.  Ever wanted to write an external sort routine? or design
a random number generator? or design floating point arithmetic
routines?  Knuth won't hold your hand, but he'll point you in the
right direction.
--

PGP public key and home page at http://www.msu.edu/user/pfaffben


Sun, 18 Jul 1999 03:00:00 GMT  
 A recent rediscovery...

 >


 > > Anyone got books they'd like to recommend, other than the usual?
 > (Everyone
 > > *ought* to have K&R2 and the book form of the FAQ already, I don't think
 > they
 > > need much more harping.)
 >
 > I would recommend _Code Complete_ by Steve McConnell, available from MS
 > Press. It covers points that are important when using any language and has
 > examples in C, FORTRAN, and BASIC. The book is very clearly written, and
 > the author backs up all of his suggestions about programming style with
 > solid data and logical reasons.  There were a few parts of the book where I
 > disagreed with his recommendations for style (i.e., how to format function
 > comments, etc.), but in the end he states that the most imprtant thing is
 > to have a consistent style and to stick with it, so that's OK :-)
 >
 > Anyone else read the book and formed any opinions on it?
 >
 > Phil

 > "Ook"  --The Librarian

I've read it and I would recommend it to anybody who cares about writing
code that is semantically correct. What I mean is, that you don't have
to wonder too much why something was done in a particular way.

IMHO, the chapter on using asserts (my personal all-time favorite) is
worth the price of the book all by itself. Using asserts to validate
function parameters and expected return values, as well as switch
default values and if statement else clause values, during debugging
will save any programmer some serious time. The only problem (a small
one at that) with asserts, is that you have to debug them, too!



Sun, 18 Jul 1999 03:00:00 GMT  
 
 [ 17 post ]  Go to page: [1] [2]

 Relevant Pages 

1. A recent rediscovery...

2. ADMIN: About the recent slowdown...

3. CDECL most recent version

4. RECENT references on C, and relation between C and C++

5. Recent posting apology

6. Recent interview with Brian Kernighan

7. Recent Questions

8. Oct.5 meeting Recent C++ Changes since the ARM

9. Looking for a recent version of MFC42.DLL

10. How to link to more recent PSDK doc (VC7)

11. Recent Files & Workspaces

12. Recent Platform SDK and IntelliSense in Visual C++ 6.0

 

 
Powered by phpBB® Forum Software