[comp.lang.c++] book review: J. Berry, C++ Programming

mike@ai.etl.army.mil (Mike McDonnell) (09/23/88)

I have mixed feelings about this book.  It takes a measured and
intelligent pace in introducing the C programmer to C++.  The examples
are interesting and relevant and the writing is clear and to the point.
Berry also is careful to point out features of C++ that can cause
problems and reasonable techniques you can use to minimize difficulties.
But.

The code is so full of errors that it is a rare example that does not
have something wrong with it.  Kernighan and Ritchie state in the
preface to The C Programming Language that "All examples have been
tested directly from the text, which is in machine-readable form."  This
was done over 10 years ago and produced a classic.  I still remember
being awed at the sheer correctness of the programs in K&R since it was
not then the norm to find this.  Nowadays this should be expected by the
reader.  Stroustrup used this technique too, of course, even testing his
code on several different systems.  From the book being reviewed, the
publisher's page says "..every precaution has been taken in the
preparation of this book."  I do not agree.

That being said, I have to admit that I enjoyed finding as many errors
as I could, and I was forced to learn the gdb+ debugger (I use the GNU
"g++" compiler) which was not a bad thing to do.  I guess I know enough
C and am used to debugging enough so that the process of working my way
through the book was actually made more enjoyable by the errors.  This
would be a disaster for a beginner though.  

Unfortunately, Stroustrup's book is not a good book to learn from
either, despite its correctness.  Bjarne has too complicated a mind
to make a simple exposition, the strength of Berry's book.  If the
errors are corrected, I think that Berry's book can be a good book for
beginners while Stroustrup will remain best for more advanced students.

One final thing; the examples are excessively dependent on System V
Unix.  The string function strtok() is used in several examples and is
not on my system (4.3BSD on a VAX).  Also the final chapter "Using C++
on a Unix System", which was written by a different author, William
Leggett, only made me wish that I had the rich suite of IPC and
synchronizing capabilities that System V has.  But I couldn't run the
code.  Are you listening, Berkeley?
-- 
Mike McDonnell at the U.S. Army Engineer Topographic Laboratories, Bldg. 2592
Fort Belvoir, VA 22060-5546   TEL:(202)355-2724   ARPA: mike@ai.etl.army.mil

henry@utzoo.uucp (Henry Spencer) (09/25/88)

In article <185@ai.etl.army.mil> mike@ai.etl.army.mil. (Mike McDonnell) writes:
>One final thing; the examples are excessively dependent on System V
>Unix.  The string function strtok() is used in several examples and is
>not on my system (4.3BSD on a VAX)...

Have you tried compiling the code?  I've been told that the System V string
functions are there but undocumented.  If not, it's a bug (and even if so,
the lack of documentation is a bug), since a public-domain implementation
existed well before 4.3 was packaged up.
-- 
NASA is into artificial        |     Henry Spencer at U of Toronto Zoology
stupidity.  - Jerry Pournelle  | uunet!attcan!utzoo!henry henry@zoo.toronto.edu

chet@pirate.CWRU.EDU (Chet Ramey) (09/27/88)

In article <1988Sep24.205501.26347@utzoo.uucp> henry@utzoo.uucp (Henry Spencer) writes:
>In article <185@ai.etl.army.mil> mike@ai.etl.army.mil. (Mike McDonnell) writes:
>>The string function strtok() is used in several examples and is
>>not on my system (4.3BSD on a VAX)...

>Have you tried compiling the code?  I've been told that the System V string
>functions are there but undocumented.  If not, it's a bug (and even if so,
>the lack of documentation is a bug), since a public-domain implementation
>existed well before 4.3 was packaged up.


They are there; if they're not in your libc.a (they are by default, but...)
look in /usr/src/lib/libc/compat-sys5.

Chet Ramey
chet@pirate.CWRU.EDU


| Chet Ramey            chet@cwjcc.CWRU.EDU    chet@alpha.CES.CWRU.EDU
|
|		Just another jerk takin' pride in his work...

isaac@goanna.oz (Isaac Balbin) (09/29/88)

I may have missed this, but I don't think so ... can someone please mail
me the details of the book ... publisher, title etc   Thanks

----------------------------------------------------------------------------
Isaac Balbin			  
Department of Computer Science,	  ACSnet: isaac@goanna.oz
RMIT,				  
GPO BOX 2476 V,                   ARPA:isaac%goanna.oz.au@uunet.uu.net
Melbourne, 3001 		  CSNET: isaac%goanna.oz.au@australia
AUSTRALIA                         UUCP: ...!uunet!goanna.oz.au!isaac

wfp@dasys1.UUCP (William Phillips) (10/03/88)

If anyone has a copy of the original review would they kindly forward it
to me?  Our news system has had the 'flu for a few weeks, and it never
arrived here.

Thanks.

-- 
William Phillips                 {allegra,philabs,cmcl2}!phri\
BEC Public Excess Unix           {bellcore,cmcl2}!cucard!dasys1!wfp
New York, NY, USA                !!! JUST SAY "NO" TO OS/2 !!!