[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: Questions for a language designer



Scott McKay wrote:
> Yes, I quite agree.  One reason I find C++ and Perl
> surprising (to use) is that the mental model seems
> incoherent to me.  What is also surprising is that
> their bizarre mental models came from one person!

I think the C++ "mental model" derives mainly from a set of constraints
related to being an extension of C, which provides object-oriented
capabilities, while remaining "close to the machine".  Much of its core
design follows fairly logically from those constraints.  It's a bottom-up
language design, starting with a CPU and its memory model as the bottom
layer.

The rest was tacked on later to fill in perceived gaps, e.g. templates,
RTTI.  Not that it couldn't have been done any other way, but I don't think
the way it was done necessarily reflects any warped twistiness of
Stroustrup's mind.

On the contrary, if you're determined to be able to exercise some control
over what a program looks like at the machine language level, without
actually writing in assembler or C, C++ is still one of the higher-level
ways to achieve that.  Whether one should want to be able to do that is a
separate question.

As for Perl, if you told Larry Wall that he came up with a bizarre mental
model, I suspect he'd take it as a compliment...