mjm said:
"Victor Bazarov" <
[email protected]> wrote in message
I liked Flanagan's Java in a nutshell. The scope is much more limited
but it is very short and fairly complete.
Perhaps "C++ in a nutshell" would be similar to what you're looking
for. Stroustrup is definitely not that.
I have a negative view of Stroustrup. The facts are diffuse, spread
all over the place and important topics are not treated exhaustively
in one place.
In addition to that there does not seem to be any desire to elucidate
what abstract principle or quality any given language construct aims
to express.
For example Barton-Nachman do this with EVERY major language
construct.
Some examples of what I could not find:
BTW, what edition are we talking about?
I could not find a definitive comparison of the notion of a variable
to that of a reference. If you just read the index for the key
"variable":
variable:
constructor for global 252
constructor for local 245
global 200, 228
number of argument 154
temporary 244, 254
There does not seem to be a place where the basic notion of a variable
itself
is treated. On page 200 and 228 there is no elucidation on the notion
of a variable. It is not worth my while to turn to page 244 or 254.
"Variable" is one of the base concepts of programming. "TC++PL" is
not supposed to teach programming, only the language. If you take
TC++PL without knowing what "a variable" is, I say, you're not ready
for it.
Elaboration on const member functions: page 229 (the anniversary
addition, only item about const member functions in the index).
Explanation by trivial example, there is not even an attempt to
formulate a definition of what a const member function is ("note the
keyword const, the function does not change the onbject") No
elaboration on such question such as
Can a const member function call a nonconst one as long as it does not
modify the object? Can a const member function return a nonconst
reference to data?
Have you really seen any book that is able to answer _any_ questions
that happen to come to the reader's mind?
If you still need answers to those questions, here they are: no and no.
Both involve conversions that are not allowed implicitly.
This is grossly inadequate.
"Grossly", huh?
Maybe all these questions are answered
somewhere in the book but topics of that importance need to be treated
exhaustively in one location.
I see you have a good understanding what is important to have in
a book. I say you should attempt writing your own.
Nested classes: p293 (only reference in the index). There is only an
example. No features are elucidated. Reading this in reference to
nested class is totally useless and should not be included in the
index.
Index should not be the first place you open when reading a book.
You should attempt reading the book in its normal order or in the
order the author suggests in the preface.
Some questions are treated under the heading of "member class" in the
appendix on page 852. Ie. no access either way but you can grant
access to the enclosing class by declaring the nested class a friend
of the enclosing class.
So, can the constructor of the member class then use data from the
enclosing class? Ie. construction of the member class would be tied to
an object of the enclosing class:
obj.new nested(i);
No elaboration.
You're trying to apply Java concepts to C++. You apparently need
a book "C++ for Java programmers". A person without prejudice should
not have a problem with nested types. Nesting of types does not
presume nesting of objects (unlike in Java). Once you abstract from
what you know in Java and try simply learning C++, you might actually
do better with Stroustrup. Unless you don't have to make an effort,
of course.
I am sure you can answer all that drawing on the
totality of the diffuse knowledge presented in this book. But not
posing and answering these questions in a treatise of 1000 pages is a
deficiency.
Trying to answer them would add more 1000s of pages to that book.
Just imagine looking at a book 3-4 thousands of pages thick. Do you
think you would buy it? Do you think you'd treat it as a normal book
or would you again try to use it as a tome of encyclopaedia, starting
with the Index?
C++ distilled by Ira Pohl is articulated much better. I think this
author is one to consider.
Good. So, you will use Ira Pohl's book. That's why there are more
than two books published on the subject.
One thing I think is important to understand. No book can cover all
topics pertaining to such huge and complex set of concepts and rules
like C++ language to everybody's satisfaction. The Special Edition
already has more than 1000 pages and would probably still not satisfy
such picky critic as yourself. Combine "TC++PL", "C++ Templates",
"C++ Standard Library", "Standard C++ Streams", "Design and Evolution
of C++", "Advanced C++", "Modern C++ Design", "Effective" series,
"Exceptional" series, "Large-Scale C++ Software Design" and you would
probably come close to covering 50% of all the questions you might
have. And we haven't even begun talking platform-specific nonsense.
Perhaps you thought C++ would be easy, once you learned Java. You
grabbed the first book that you heard of, the one that started it all,
and went for the index to see how the syntax is different from Java
so that you could quickly rewrite what you have into C++ and be done
with it. Oops, it doesn't even have those concepts you were used to
while doing some Web server development. And, instead of scrapping
your previous approach and starting with the clean slate, you throw
the book away with disgust and a label of "inadequacy". However, as
shown by countless examples over the past fifteen years, other
programmers successfully used that book to learn the language and
never complained. I am not going to answer it, but a question is
nagging: who's inadequate?
Victor