Christopher Smith wrote:

Popularity of a programming language comes from somewhere. If C++ is
really that horrible and unworkable, people wouldn't use it for
projects. Sure, it is far from perfect, but it seems to fall in to the
"good enough" category more often than not.

So was Cobol.  That doesn't mean it wasn't painful.  ;)

The question I would ask is: "What gets chosen when business constraints are weaker?"

Take a look at the current crop of revision control systems. Git (C and shell scripts), Bazaar and Mercurial (Python), darcs (Haskell). Games seem to be moving to more and more Lua and Python while only the graphics core stays in C/C++. For web stuff, C++ is completely at the bottom (you would think that something so popular would have spawned an interpreted version rather than completely new languages, no?).

Yeah, they did the rewrite in 1998. The original post was referring to
those fantastic initial browsers developed by 1994 providing some
overwhelming advantage to browser projects inheriting that codebase.

At no point did I claim overwhelming advantage. However, the fact that it's already *in* C++ is certainly going to change the discussion from "Should we use Java/Python/Perl/Lisp/etc?" to "Should we really change from C++?" It changes the dynamics from "go with the flow and avoid blame" to "take the blame if something goes wrong (and it always does)."

Inertia is powerful.

I'm sorry, but I wrote a browser back then with a college roommate, and it
just wasn't that hard. Hell, the timeline between when Netscape was
founded and Netscape 0.9 was released was 6 months (admittedly, they had
people working on it who'd written a browser before, but there is no
reason why you couldn't have the same kind of people developing a
browser in a different programming language) and it was already better
than the others!  There was so little code to put in to a browser the 2.0
version added a *mail client* for goodness sake!

jwz would like a word with you ...

But your mention of the huge Mozilla rewrite is exactly my point. They
ended up keeping basically zero code from the original code base, so it
was effectively rewritten from scratch in 1998.

No, it wasn't. They pulled out major subsystems and wrote them from scratch. This means that the new subsystems had to fit into where the old subsystems sat.

Inertia, again ...

and been at no additional disadvantage compared to the Mozilla project
(and presumably would have an advantage since they had a significantly
better programming language to work with). Despite this, Mozilla ended
up being the #2 browser out there, and probably one of the best working
ones. All of the ones that I think of even coming close to it are also
written in C++: IE, Opera, and KHTML-based browsers.

Microsoft wasn't going to use Java if hell froze over, so the only options were C++ or Visual Basic. Opera targets small systems so is stuck on C/C++. The KDE guys are "Give me Qt or give me death!" zealots so nothing other than C++ will do.

But it's like C++ with automatic memory management.... so surely it
would at least be better than C++ for almost any project, right? ;-)

Pretty much.

However, it seems that anyone enlightened enough to see the advantage of Java over C++ is also enlightened enough to see the advantage of Tcl/Perl/Python/etc. over Java.

Again, I'm not arguing that C++ is the best language. Far from it. I'm
merely suggesting that it isn't quite so completely useless. It is
popular to trash it largely because it is so widely used.

Actually, Java has that mantle now.

Sure other
languages are better (indeed, because of C++'s popularity, it nearly
impossible for a language that is worse than C++ to survive as anything
but a niche or legacy language), but they clearly aren't overwhelmingly so.

And there we disagree. The combination of context-sensitive grammar, non-managed environment and static compilation really are major misfeatures.

Even worse, nobody seems really interested in correcting them. There's no particular reason a C/C++ implementation couldn't gain those things. However, anybody who would be motivated to do so seems to realize that other languages have already done so and have more benefits besides.

Maybe CIL or LLVM will help that situation.

-a

--
[email protected]
http://www.kernel-panic.org/cgi-bin/mailman/listinfo/kplug-lpsg

Reply via email to