C++ (was RE: Python suitability)

Alex Martelli Alex.Martelli at think3.com
Thu Dec 16 11:14:00 EST 1999


James Logajan writes:


> Alex Martelli attempts to ignite a flame war:
> 
Actually, if a flamewar is going on in this thread, I'm
not participating in it (the flamewar, not the thread:-).


> > I'm not surprised that a Python enthusiast may not appreciate
> > C++'s basic underlying philosophy, since it's so close in many
> > surprising respects to Perl's -- reading Larry Wall's musings on
	[snip]
> This would explain why the syntax of Perl and C++ suck equally and yet so
> differently. But Stroustrup at least had a glimmer of a philosophy. Wall
> had
> none.
> 
Now _that_ is inflammatory, my friend.  And quite false, too.

One example: both C++ and Perl deliberately set out to
mimic certain aspects of C's syntax -- C++ more closely,
aiming for almost-but-not-quite-compatibility in fact -- in
both cases, not due to any real liking for that syntax (who
could possibly _like_ it?-), but in the belief that finding a
somewhat familiar syntax would lower new programmers'
barriers to acceptance.  (In Perl's case, other languages
that could be presumed familiar to the intended initial
target audience, such as Unix shell languages, were
also kept just as firmly in sight).

They both apparently succeeded, judging from the huge
usage bases of C++ and Perl today.  Java deliberately
adopted this same aspect later, of course -- striving to
give superficially familiar syntax (hiding perhaps very
different semantics).

I find it sad that this philosophical stance worked, not
"per se", but because it does suggest that programmers
pay far more attention to surface issues such as that
of vaguely-familiar syntax, that I think it would be wise
for them to (and perhaps less attention than they should
to deeper issues such as elegance and cleanliness).
Oh well, so much for my optimism about human nature!-)


Another example of commonality is the whole-hearted
embrace of "multi-paradigmaticity", just to coin (?) a
hi-falutin' word.  Wall and Stroustrup moved from a
very overt philosophical stance of, "it's not my job to
_guide_ the programmer in any real way, but rather
provide multifarious possibilites, among which the
programmer, being a great designer and architect,
will choose optimally".  That is in sharp contrast with
the language-design philosophy of many other
languages, which _do_ attempt to guide to a much
larger extent.

(Incidentally, my newbie's impression of things is
that Python strikes a happy medium in this respect --
but maybe that's just the happy blush of blossoming
love:-) -- not going out of its way to provide many
different/redundant approaches, but neither actively
hampering what some consider 'bad' things...:-).


> > One key difference is that, in C++, you _can_ design and
> > maintain huge and flexible projects -- the language does not
	[snip]
> > constraints of performance, where every microsecond
> > does matter).
> 
> I'm sorry, but drop the "++" and you could have made these same arguments
> two decades ago about C. You sure you didn't cut and paste this from
> something 20 years old and add some plus signs?
> 
If, indeed, the philosophy and practice of C++ are so
close to those of C in its heyday, I'm not sure why you
should be sorry -- since that was exactly Stroustrup's
guding philosophy!-)


Alex





More information about the Python-list mailing list