Registered: Jun, 2003
Re: Designing a Language for Library Developers
Posted: Oct 13, 2005 10:49 AM
> It's a good thing that Bjarne Stroustrup doesn't have a
> thin skin, because C++ sure gets trashed enough. Designing
> a new language and weathering the process of getting
> nit-picky opinionated programmers to use it must be hard
> on the ego.
> Any C++ programmer can find
> things about C++ to criticize, but few can write something
> even half as useful as C++ themselves.
Having spent a fair amount of time around Bjarne, I have been very impressed with his diplomacy. Also true for Guido Van Rossum, who spends his time hip-deep in his community. But I've occasionally seen both of them lose their composure after being pecked to death by ducks once too often.
Designing a language for mainstream acceptance requires, I believe, much more than a technical understanding of things, but especially a sense of economics and of psychology. The irony is that, although we as programmers inhabit a digital world, there are very few binary questions. For example, checked exceptions seem brilliant on the chalkboard, but they may actually impact the productivity of programmers and cost more than they're worth, and at the same time become part of the background noise so you can't see the impact, and continue believing they are the best of all possible worlds.
One difference between my C++ experience and my Java experience is that, because I participated in the C++ committee, I saw the decisions being made, argued and justified. And indeed, a lot of it came back to "backwards compatibility with C," C++'s strength and the millstone around its neck. So I know why the decisions were made and I don't think the language could be less complex than it is, all things considered.
Java, on the other hand, has many misfeatures (some of which have been fixed over time) that came, probably, from rushing the thing out and having part of it designed by marketers, or at least marketing-minded people. And since the Sun crew is usually reluctant to admit mistakes, we are left to our own devices, sometimes years later figuring out by ourselves that someone just didn't know what they were doing when they put suspend(), resume(), stop() and destroy() into Java threading (of course, that was an obvious one. There are far more subtle "fixes" that slip through the radar, that just leave you with an uncomfortable feeling, but it's put forth like "we've always known what we're doing, we're infallable." We're now finding out that EJB1 and 2 really were the emperor's new clothes because of a complete ivory-tower misunderstanding of how that tool would be used (and I think the backlash from this will last for years). I think the approach to Java generics will, after the years it takes for everyone to finally figure them out, be understood to be a collection of design decisions made based on faulty assumptions, and the cost to programmers (and, eventually, the language) will be significantly greater than the short-term benefits gained by making these choices.
But with Java I can't always know what was a mistake and what was a well-thought-out decision until sometimes long after the fact, whereas with C++ I know, and have come to trust that, even if I don't understand something right away there is logic behind it. That gives me a fundamentally different feeling about the two languages. (And if it isn't obvious by now, Python is still my favorite out of all of these).
Again, language design is a really tough thing to do. It's really hard to be omniscient (although that would be the ideal for a language designer -- just do it and throw the thing out there), but once you open yourself up to everyone's opinions, you have to sort through all the half-baked or half-understood ideas, figure out what's really right, and end up making decisions as if you're omniscient anyway.
I applaud Christopher for trying, and for struggling along this path. But it's going to be a huge struggle, and I believe that a lot of the struggle will probably involve learning to become both a diplomat, and when enough of the information is in, a strong decision maker, like Stroustrup and van Rossum.