jimad@microsoft.UUCP (JAMES ADCOCK) (02/21/90)
I just found and bought another C++ book:
"The C++ Workbook"
Wiener & Pinson, 349 pgs
Addison-Wesley 1990
ISBN: 0-201-50930-X
$28.95 [at my local bookstore]
So far I've read four of nine classes, and have not been impressed.
I greatly prefer Hanson's "The C++ Answer Book" in spite of the fact that
Hanson's book is based primarily on the 1.2 version of the language,
while "The C++ Workbook" claims to be based on 2.0
But "The C++ Workbook" gets some of the important 2.0 stuff totally wrong,
so I'm not sure that the fact that Hanson's book is based on 1.2 is
a relative disadvantage. For example, "The C++ WorkBook" claims:
" When declaring a data member to be *static* it *must not require
initialization*. For ordinary C-types, the static declaration causes no
problems because ordinary C-types do not require initialization. See, for
example, *static int small* in class A and *static int count* in class B in
Listing 3.17.
*If an instance variable of a class is to be declared as static, the
requirement for no initialization requires that the class have no
constructors and, further, that none of its data members be instances of a
class with constructors.* A number of variations on the use of static
declarations with the resulting acceptance by CFront are given in Listing 3.17"
--Which is dead wrong, and would lead a person not knowing better to beleive
that static instances have almost no applicability.
***Sigh***
For comparison, Lippman gets the description of static members dead right,
and very clearly, concisely, and correctly states their usages and the
issues involved.
Program examples in "The C++ Workbook" are given in an very-large, bold,
sans-serif, variable spaced text. Indentation is by about half a character
width. Many examples are very abstract:
[quote]
class Second
{
private:
int anInt = 6; // error; initialization not allowed
int anotherInt;
public; [sic]
Second( void ){anInt = 6;}
Second( int inInt3m int inInt4 ) : anInt( inInt3 ), anotherInt( inInt4 ) {}
[unquote]
etc. Thus, I find it hard to extract meaningful information from the
programming examples. If I finish the book, and change my mind about it,
I will post again. The book does include more of the OOP buzz-words than
most C++ texts.
For reference, compare to:
"C++ Primer", Lippman, Addison-Wesley, 1989, ISBN 0-201-16487-6, 464 pgs
"The C++ Answer Book", Hansen, Addison-Wesley, 1990, ISBN 0-201-11497-6,
578 pgs, $26.95
[standard disclaimer]broughtn@flamingo.metaphor.com (Justin Broughton) (03/03/90)
As someone new to C++ I was obviously not aware of the inaccuracies. The book
does however have its merits. It seems to take a much better approach to
teaching C++ starting from OO principles (No buzz words intended I am sure).
I also like its honesty with respect to the obvious faults of C++ e.g.
"The more general support for generics ... is not well supported in C++. The
type void * is assignment compatible with a pointer to any other type. This
feature coupled with some macros and a lot of effort can provide additional
generic support in C++. Parameterized types, where the type is specified
by a parameter, offer a better solution for generic support"
Justin
-------------------------------------------------------------------------------
Justin Broughton, Metaphor a.k.a. broughtn@flamingo.metaphor.com
"Mother Nature is dying. Wake up!"
My opinions are my own, My employer's are her/his own and hardly the twain meet
-------------------------------------------------------------------------------