Thinking about C++

ziggy on 2003-08-31T16:51:31

Every time I read an interview with Bjarne Stroustroup (like this one), I remember what I like about C++. Bjarne was very explicit in his goals. For the most part, they have been realized:

LJ: Are you proud of your C++ language?

BS: Naturally. I'm very happy with the way it allows me to write programs that are simultaneously elegant and efficient. I'm also quite proud of its widespread use.

But whenever Bjarne notes his happiness with the language, it is almost always tempered with this bit of reality:
That said, I don't claim that C++ is perfect. There is a lot of really horrible C++ code out there, because many programmers haven't learned to use C++ well. I encourage people to look at my home pages, papers and books for ideas about how to improve their code. My impression is that most C++ code could have been much cleaner, maintainable and efficient than it is had the designers and programmers understood up-to-date C++ features and techniques. Standard C++ really does make possible programming techniques that were infeasible ten years ago. Unfortunately, many are constrained or feel constrained to use C++ as it stood ten years ago, or they simply use it as a better C.

LJ: How do you feel now, knowing that millions of people work using the tool you created?

BS: I'm very pleased, but as I said, I wish they'd do themselves a favor by using it better.

Perhaps humility is the most important quality a language designer can posses. Hubris about C++ is almost exclusively limited to its true belivers. Maybe in a few years, we can all move past this meme of «the one best language for everything». I for one would love to see that, but I'm not holding my breath.


Hmmmm

samtregar on 2003-08-31T18:30:38

I'm not so sure. Contrast this with Larry Wall's emphatic "baby Perl is OK" philosophy. Larry seems to feel that Perl is so good that even using it badly (i.e. not excercising the latest and greatest features) is still worth doing. Bjarne seems to be saying that people need to get up to speed with the latest C++ "improvements" or they'll suffer for it.

I think I'd rather have a language designer that can create something so good that he doesn't have to apologize for it later. Frankly, for all the good in C++ I think Bjarne has a lot of explaining to do!

-sam

Re:Hmmmm

ziggy on 2003-09-01T02:14:02

Larry and Bjarne agree that there is no such thing as the One True Programming Language. Larry decided to focus on making people more productive. Bjarne decided to focus on efficient, expressive code. These are fair choices, each with their attendant consequences.

It's good to have multiple points of view. We'd be poorly served if the only path to efficient code were C or asm. We'd be just as poorly served if the only path to programming focused overmuch on efficency instead of correctness, expressiveness, ease of use or ease of learning.

Re:Hmmmm

samtregar on 2003-09-01T04:34:18

Sorry, should have been more specific. Your comment about there being no such thing as one true language is of course 100% correct. I was more interested in your comments about humility being an important characteristic in a language designer. Sure, it's nice of Bjarne to apologize for C++ but maybe I'd rather use a language that required a few less mea culpas!

-sam