Re: New C++ programmer experience of C++ books
Andrew Koenig wrote:
"Stephen Howe" <sjhoweATdialDOTpipexDOTcom@giganews.com> wrote in message
news:bvGdnWhDysaUyuLYnZ2dnUVZ8q6nnZ2d@pipex.net...
I thought I would mention the experiences of a programmer at work.
He is a died-in-the-wool COBOL programmer but is trying to learn C++ as
increasing development is done in this.
He wanted to know if there were C++ reference manuals that would explain
the
entire syntax of classes.
And he could not find one despite having many of the popular books on
C++
including the ISO C++ standard in book form. What was beating him was
that
he could not find an _immediate_ explanation for the colon in
class Derived : public Base
{
// other details
};
when looking up classes in any of the popular books. Every single C++
book
introduced that ":" under the "advanced concept" of inheritance. Yet the
code compiled without problem (Gnu), so it looked like the compiler
thought
it was okay. He pointed out that his COBOL manual for each statement,
gave
the complete syntax. Where was the equivalent for C++?
Stroustrup's "C++ Programming Language" explains it in Appendix A
(grammar)
on pages 808-810.
As should any good reference manual. (Stroustrup's book is
doubtlessly the best reference manual around, but I doubt it is
the only one.) Of course, Stroustrup's book isn't ONLY a
reference manual; there's also a lot of pedagogic material in
it. And all of the "popular books" I know are more pedagogic in
scope. And it seems reasonable to me that a pedagogical
presentation would present classes first, and only address
inheritance later; I'm pretty sure that that's the way
Stroustrup does it in his pedagogical presentation which makes
up the main body of his book, or at least the first part.
I think the problem here is that the reader is not making this
distinction between pedagogic and reference. If you look up
class in the index of Stroustrup's book, and go the first page
referenced, I doubt you'll find the colon mentionned, simply
because the pedagogic part of the book comes before the
reference manual, and so has lower page numbers. If he had
limited his research to page numbers in the reference part, I'm
sure he would have found a clear explination.
--
James Kanze (GABI Software) email:james.kanze@gmail.com
Conseils en informatique orientie objet/
Beratung in objektorientierter Datenverarbeitung
9 place Simard, 78210 St.-Cyr-l'Icole, France, +33 (0)1 30 23 00 34
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]