[ale] Language Jihad!

Joseph A. Knapka jknapka at earthlink.net
Wed Jul 18 16:20:50 EDT 2001


Benjamin Scherrey wrote:
> 
> On Wednesday 18 July 2001 03:10 pm, Wandered Inn wrote:
> > Benjamin Scherrey wrote:
> > >         Critics of C++ claim its too complex. Certainly, to use all of
> > > C++, you've got a long learning curve. However, its not necessary to know
> > > more than 25% of the language's features to take great advantage of it.
> >
> > This is ludicrous.  So which 25% do you learn?  How do you know you're
> > doing it the right way if you don't know the language?
> 
>         Its not ludicrous at all. Reconsider your definition of the language. How
> much of your C code is the "C" language vs. C with a lot of standard library
> functions. Well, the same is true of C++. The C++ standard library is huge.
> However, a little knowledge of some of the string interface and a couple of
> containers, throw in a class or two and perhaps some inheritence and
> suddenly you don't have to know the idiocyncracies of pointers to do useful
> work. Its not necessary to know RTTI, exceptions, templates, most of the
> stdc++lib, etc. to get useful code out of C++. The strong typing and const
> correctness of the language produces much better error messages and prevents
> most runtime errors that plauge new (and old) C programmers. The nice thing
> is that, as you need techniques provided by exceptions or templates, you can
> evolve into them on as as-needed basis. This is the marvel of "don't pay for
> what you don't use".

Possibly you can write correct C++ code knowing only 25% of the
language,
provided you write all the code yourself and don't have to deal with
code written by others. But if you're going to use third-party
libraries,
or your code has to interact with code written by others, or you want
to make effective use of the C++ standard library, you really have to
understand how the language works, in order to write *correct* (not
merely elegant, efficient, or useful) code. The standard library uses
most of the features of the language. I don't really see how you
can avoid knowing about pointer semantics and the way pointers are
encapsulated by library classes in order to do C++ right.
I've seen people to things like call std::string.str() and then try
to delete the result. It sounds stupid if you know what's going on,
but if you don't, it's not obviously wrong. And "new" can throw
exceptions, so if you use it (and who doesn't?), you need to know that,
and how to deal with it. You may not pay for what you don't use, but you
still need to understand it. ("Don't pay for what you don't use" is a
statement about performance of C++ programs, not about language
knowledge.)

MHO, as usual.

<borrows wooden stake and mallet from Buffy in attempt to put
this thread to rest>

<recognizes the irony implicit in the above statement, too>

Regards,

-- Joe Knapka
"You know how many remote castles there are along the gorges? You
 can't MOVE for remote castles!" -- Lu Tze re. Uberwald
// Linux MM Documentation in progress:
// http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
* Evolution is an "unproven theory" in the same sense that gravity is. *
--
To unsubscribe: mail majordomo at ale.org with "unsubscribe ale" in message body.





More information about the Ale mailing list