[NCLUG] Books?
Rich Blinne
richblinne at hotmail.com
Thu Feb 15 09:15:45 MST 2001
----Original Message Follows----
From: Sean Reifschneider <jafo at tummy.com>
Reply-To: nclug at nclug.org
To: nclug at nclug.org
Subject: Re: [NCLUG] Books?
Date: Wed, 14 Feb 2001 16:50:49 -0700
On Tue, Feb 13, 2001 at 05:51:18PM -0800, J. Paul Reed wrote:
>On 02 Dec 2000 at 13:03:29, Luke Light modified my mailspool to say:
>> I am interested in learning C++ and was wondering if anybody would
>> recommend any books? I checked out GNU C++ For Linux, any opinions on
>> that book?
>
>I would recommend both Stroustroup's "The C++ Programming Language" (3rd.
>Edition) for reference and advanced topic purposes... and Lippman's C++
That one's not bad, but I'd whole-heartedly recommend Programming In Python.
;-)
The Design and Evolution of C++ by Stroustrup I really enjoyed. It's a
"Here's why C++ is the way it is" book, which really helped me grok it.
--------------
Learning some of that can be real helpful. Back in 1990, I presented at a
poster session for the C++ Usenix conference. It was about my type
parameterization system as this was pre-templates in C++. I had a chance to
talk a bit with Bjarne Stroustrup, Stan Lippman, and Andy Koenig. As I was
saying, at that point in time they were trying to add templates and
exceptions to the language. Bjarne was very much trying to keep the number
of keywords to a minimum. So, he had a very lame proposal with respect to
exceptions. That is, having one new keyword catch. So, if you catching an
exception you used catch and if you were throwing an exception you used --
catch. The analogy that Bjarne gave was when playing ball you would yell
"Catch!" as you threw the ball! Fortunately, the ISO committee killed this
and added a throw keyword. This example was illustrative of some of the
historical baggage of C++. Some of them were:
1. C++ can be a better C. It does type checking and automatic type
conversion without the OO features. This is one reason why it is not as
pure an OO language as either Java or Python.
2. Speed is essential. Remember, C++ grew up when Smalltalk was the cat's
meow. But Smalltalk ran so slowly that it was impractical. This gave rise
to the vtables inside of C++ where some of the method selection was
pre-computed by the compiler. In fact, the virtual keyword which provided
run-time polymorphism came out only in version 2 of the cfront
implementation of C++.
3. Multiple inheritance came late. C++ started out with only single
inheritance. At the above-mentioned 1990 conference, T.A. Cargill presented
a paper stated that multiple inheritance was unnecessary. Multiple
inheritance was implemented with the add new keywords at pain of death.
Thus, you had the keyword virtual overloaded a lot. (Pun intended)
4. Re-use libraries were developed prior to working templates. So, all of
the people including myself developed our own infrastructures to do our kind
of template instantiation. (My paper was about my library that I did for
NCR.) Even "standard" implementations did this. The Unix System
Laboratories library did not use templates but had its own template
instantiations. Microsoft did the same for their foundation classes. This
was recognized back in 1990 as a real problem that there was not a standard
re-use library for C++. The problem is that implementing the ISO/ANSI
standard langauge proved to be extremely complicated. This is borne out by
it taking eleven years for both open source and proprietary solutions to
actually deliver the standard library.
So, now you know in part why C++ is so complicated. Its history made it
not nearly so "pure" an OO language and also delayed re-use libraries by
about a decade. Nevertheless, it still runs rings performance-wise around
other more "pure" solutions. It has, is, and probably always will be a
pragmatic rather than an ideological language. For those of us who have to
get real product out on time and have the product be small and fast we owe a
debt of gratitude to Bjarne Stroustrup. It was Bjarne's dedication to make
sure it "works" over theoretic purity which made C++ what it is today.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
More information about the NCLUG
mailing list