Re: Type System as Design Tool [Was: We do not use C++ exceptions]
Thant Tessman wrote:
Andrei Alexandrescu wrote:
[...]
It is appalling, but in a funny way, how this group has lately witnessed
a flak of statements that not only lack any shred of competence, but
also come with fantastic aplomb.
"Java is what you get when you add GC to C++ and take away those scary
template things."
Doesn't this exactly describe Java? Pretend you're James Gosling and
it's the birth of the internet and you've been charged with designing a
programming language for what at the time were called "remote agents."
{ Mod factoid: Java started as a language for embedded systems, e.g. see
<http://en.wikipedia.org/wiki/Java_(Sun)#History>. -mod }
Gotta love the moderator kindly "helping" the conversation :o|.
Here are the design criteria I imagine went through his head:
* Run-time safe;
* Object oriented;
* Shallow learning curve;
* Easy to implement.
The "shallow learning curve" criteria implies that it be 'culturally'
familiar to as many programmers as possible. This implies that it should
be as C-like as practical.
As for OO, there were already two popular efforts to extend C with
constructs to support OO methodology: Objective-C and C++. So you decide
to borrow as much of C++'s design as you can without taking what you
consider to be features that cost more in complexity than they gain in
expressiveness (like multiple inheritance and templates). Going with C++
also helps keep things "culturally familiar."
The "run-time safe" criteria implies the use of a virtual machine and
automatic memory management. And "automatic memory management" doesn't
mean stack-triggered constructors and destructors. It means automatic
memory management.
And you have to remember that templates were far more controversial at
the time than they are now. (Actually, I've worked with plenty of people
who still consider them controversial.)
Maybe you (not James Gosling) would have made different decisions about
how to balance expressiveness and complexity given the design criteria,
and maybe it's a bit of an oversimplification, but I stand by my
statement: Java is what you get when you add GC to C++ and take away
those scary template things.
No. I don't need to pretend I'm Gosling. This imagining what went
through someone's head etc. is nothing else but rampant speculation that
only reveals utter ignorance of: the history of Java, the history of
C++, the charters of these two languages, and how each of them fulfilled
its charter according the criteria they themselves chose and also the
criteria chosen by others. Again: this speculation stems in and reveals
utter ignorance. I mean "ignorance" as in, there is information that
exists but is not in one's possession. That should be enough to curb
anyone's desire to emit definitive opinion. It puts no one else in a
poor light but oneself.
I mean if one doesn't like Delphi, is it a good social cause to hang out
in a Delphi newsgroup and start the whine noise generator?
I use C++ every day, so I have a vested interest. I've been trying to
draw attention to the way one's programming language colors one's
thinking about the craft of computer programming. I can understand that
if a person is emotionally attached to a programming language, they
might find this particular message annoying, but it isn't "noise" if I
may be so bold.
Confusion of deterministic with scoped? Noise. I'm not even mentioning
the other strident tones again. Noise, noise, and noise. I am sorry, I
will leave this dialog.
Andrei
--
[ See http://www.gotw.ca/resources/clcm.htm for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]