DNAunion2000
07-27-2003, 01:22 PM
/*DNAunion*/ Just bought (and am about to return) the book Microsoft Visual C++ .NET Step by Step (Microsoft Press 2003). I definitely do not recommend this book for beginners (or those already proficient in C++).
A lot of its "teaching" is done by cookie-cutter programming: find this line of code in the program…don’t worry about what it actually means…now type these things under it…don’t worry about what they mean either…now compile. The reader gets working programs without ever knowing what x, y, and z mean.
And the authors don’t know how to teach step-by-step, despite the book’s title. It’s as if they can’t decide what their target audience is. Are they writing a step-by-step book (as the title implies) that gradually walks beginners through from beginning to end? Sometimes. Or are they writing a book for people who already know C++? Sometimes. The worst part is that while it is possible to do both in one book, the authors manage to do neither. Beginners will be confused by the disorganized introduction of material (pointers and classes in chapter 2) and lack of explanations, while the already-proficient-in-C++ programmer won’t learn enough new stuff to make the book worthwhile.
Here are some details. The text starts on page 3. So in a sense, you should subtract 2 from each page number listed to see how many pages into the book the passage is found.
”The first line uses the directive #include to tell the C++ compiler to copy in the file named iostream at the beginning of the program.” (p4)
/*DNAunion*/ ‘Compiler’? What’s a compiler? The book hasn’t told the reader.
”… (the endl stream manipulation operator inserts a new-line character in the stream.)” (p5)
/*DNAunion*/ What the heck is a ‘stream’, an ‘operator’, and a ‘new-line, and what in the world does it mean for an operator to manipulate a stream?
I knew the answers to the questions I posed from a newbie’s point of reference, so I could follow the discussion…but a newbie would likely be confused already…only 4 pages into the book.
The next “What the…?” is somewhat confusing even for someone familiar with C++.
”How does the compiler know which function should be called first? … The rule is that the compiler will always generate code that looks for a function named main. If you omit the main function, the compiler reports an error and doesn’t create a finished executable program.” (p6)
/*DNAunion*/ That alone is not a problem. The problem arises when the rest of the book violates the rule just provided, without explaining why!
Only the first program in the book – the trivial “Hello World!” program -- uses Standard C++ (iostream, cout, etc.). The second and subsequent programs don’t include a main() function! Yet the authors told the readers only a dozen or so pages earlier that every C++ program must have a main() in order to compile. What gives?
The book has the reader “blindly” begin typing the second program on page 20, and that program contains several non-Standard C++ entries and omits several of the most common Standard C++ elements.
(1) The program does not have a main() function but does have a _tmain(). What exactly is a _tmain() function anyway? The book doesn’t say.
(2) The program does not have the typical #include <iostream> directive but does have #include “stdafx.h”. So what exactly is the “stdafx.h” anyway? The book doesn’t say. And why is this one surrounded by double quotes instead of by angle brackets? The book doesn’t explain that either (a newbie might be confused further).
(3) The program does not have the typical using namespace std; statement but does have #using <mscorlib.dll>. What exactly is the <mscorlib.dll>? The book doesn’t say. And why is the typical using statement (such as using namespace std;) not prepended with a pound sign while the program’s #using <mscorlib.dll> is?
(4) Related to the above, the program has a using namespace System; statement. So what exactly is the System namespace? The book doesn’t tell the reader (one has to know what it is from reading other material on .NET).
Here’s another newbie-stumper.
”To access the member variables and functions, you have to dereference the pointer in one of two ways. You can use the dereferencing operator, an asterisk (*) followed by the dot notation – for example, (*cat).legs. “ (p23)
/*DNAunion*/ Dereferencing a pointer? What the heck is a pointer? What the heck is dereferencing? The book hasn’t explained either yet.
And why in the world is the book already talking about classes? Functions haven’t even been covered, nor have variable types, looping, selection, scope, pointers, etc.
”The lifetime of an object instantiated from the class will be managed by the .NET Framework’s garbage collector. When the object falls out of scope, the memory used by the object will be garbage-collected and no explicit calls to delete will have to be made.” (p22)
/*DNAunion*/ What the heck does “fall out of scope” mean? A newbie wouldn’t know from reading the book. What the heck is delete? And should the book really be discussing advanced topics like dynamic memory allocation and memory management when less than 2 dozen pages in?
Now note the difference between these two.
Console.WriteLine(“Animal 1”); (p25)
and
Console::WriteLine(S”Welcome to your friendly Investment Planner”); (p49)
/*DNAunion*/ Why does the second one prepend a capital ‘S’ to the string while the first doesn’t? The book doesn’t say.
So far I’ve been disappointed with several of the Microsoft Press books I have purchased. It is almost as if they are just pumping them out one after another…each one half done…just to get presence on the shelf: knowing that people are more likely to by an authentic Microsoft book on Microsoft products.
******************************
PS: Phrases such as “The book doesn’t say” should be interpreted to mean “The book doesn’t say, or at least doesn’t say until later on in the book”.
A lot of its "teaching" is done by cookie-cutter programming: find this line of code in the program…don’t worry about what it actually means…now type these things under it…don’t worry about what they mean either…now compile. The reader gets working programs without ever knowing what x, y, and z mean.
And the authors don’t know how to teach step-by-step, despite the book’s title. It’s as if they can’t decide what their target audience is. Are they writing a step-by-step book (as the title implies) that gradually walks beginners through from beginning to end? Sometimes. Or are they writing a book for people who already know C++? Sometimes. The worst part is that while it is possible to do both in one book, the authors manage to do neither. Beginners will be confused by the disorganized introduction of material (pointers and classes in chapter 2) and lack of explanations, while the already-proficient-in-C++ programmer won’t learn enough new stuff to make the book worthwhile.
Here are some details. The text starts on page 3. So in a sense, you should subtract 2 from each page number listed to see how many pages into the book the passage is found.
”The first line uses the directive #include to tell the C++ compiler to copy in the file named iostream at the beginning of the program.” (p4)
/*DNAunion*/ ‘Compiler’? What’s a compiler? The book hasn’t told the reader.
”… (the endl stream manipulation operator inserts a new-line character in the stream.)” (p5)
/*DNAunion*/ What the heck is a ‘stream’, an ‘operator’, and a ‘new-line, and what in the world does it mean for an operator to manipulate a stream?
I knew the answers to the questions I posed from a newbie’s point of reference, so I could follow the discussion…but a newbie would likely be confused already…only 4 pages into the book.
The next “What the…?” is somewhat confusing even for someone familiar with C++.
”How does the compiler know which function should be called first? … The rule is that the compiler will always generate code that looks for a function named main. If you omit the main function, the compiler reports an error and doesn’t create a finished executable program.” (p6)
/*DNAunion*/ That alone is not a problem. The problem arises when the rest of the book violates the rule just provided, without explaining why!
Only the first program in the book – the trivial “Hello World!” program -- uses Standard C++ (iostream, cout, etc.). The second and subsequent programs don’t include a main() function! Yet the authors told the readers only a dozen or so pages earlier that every C++ program must have a main() in order to compile. What gives?
The book has the reader “blindly” begin typing the second program on page 20, and that program contains several non-Standard C++ entries and omits several of the most common Standard C++ elements.
(1) The program does not have a main() function but does have a _tmain(). What exactly is a _tmain() function anyway? The book doesn’t say.
(2) The program does not have the typical #include <iostream> directive but does have #include “stdafx.h”. So what exactly is the “stdafx.h” anyway? The book doesn’t say. And why is this one surrounded by double quotes instead of by angle brackets? The book doesn’t explain that either (a newbie might be confused further).
(3) The program does not have the typical using namespace std; statement but does have #using <mscorlib.dll>. What exactly is the <mscorlib.dll>? The book doesn’t say. And why is the typical using statement (such as using namespace std;) not prepended with a pound sign while the program’s #using <mscorlib.dll> is?
(4) Related to the above, the program has a using namespace System; statement. So what exactly is the System namespace? The book doesn’t tell the reader (one has to know what it is from reading other material on .NET).
Here’s another newbie-stumper.
”To access the member variables and functions, you have to dereference the pointer in one of two ways. You can use the dereferencing operator, an asterisk (*) followed by the dot notation – for example, (*cat).legs. “ (p23)
/*DNAunion*/ Dereferencing a pointer? What the heck is a pointer? What the heck is dereferencing? The book hasn’t explained either yet.
And why in the world is the book already talking about classes? Functions haven’t even been covered, nor have variable types, looping, selection, scope, pointers, etc.
”The lifetime of an object instantiated from the class will be managed by the .NET Framework’s garbage collector. When the object falls out of scope, the memory used by the object will be garbage-collected and no explicit calls to delete will have to be made.” (p22)
/*DNAunion*/ What the heck does “fall out of scope” mean? A newbie wouldn’t know from reading the book. What the heck is delete? And should the book really be discussing advanced topics like dynamic memory allocation and memory management when less than 2 dozen pages in?
Now note the difference between these two.
Console.WriteLine(“Animal 1”); (p25)
and
Console::WriteLine(S”Welcome to your friendly Investment Planner”); (p49)
/*DNAunion*/ Why does the second one prepend a capital ‘S’ to the string while the first doesn’t? The book doesn’t say.
So far I’ve been disappointed with several of the Microsoft Press books I have purchased. It is almost as if they are just pumping them out one after another…each one half done…just to get presence on the shelf: knowing that people are more likely to by an authentic Microsoft book on Microsoft products.
******************************
PS: Phrases such as “The book doesn’t say” should be interpreted to mean “The book doesn’t say, or at least doesn’t say until later on in the book”.