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

Re: Strong Typing, Dynamic Languages, What to do?

"Anton van Straaten" <anton@appsolutions.com> writes:

> Oscar,
> We seem to have staked out our respective positions fairly predictably.

Yes, I'm afraid :-)
> However, you've implied that there's some advantage to the C++ lack of true
> type safety, but you haven't actually said what that is.
> The only real argument for the shortcomings of C++ in this area is its role
> as an object-oriented assembly language: avoiding runtime overhead that the
> programmer doesn't explicitly create.

Well, you've just explained it. I can convert a byte buffer to an
array of MyObjects with a line of code that actually is a no-op in
terms of execution time.

BTW, regarding C++ as object oriented this days is even more
misrepresentative than 10 years ago. Current modern C++ idioms are
everything but object oriented.

> Like assembly language, though, this role becomes increasingly
> marginalized as safer languages match or exceed the efficiency of
> C++.

Although it is very possible that other languages can exceed C++ (see
Ocaml) I doubt that them will do the task of a better assembler using
high level idioms, which is one of the roles C++ plays.

> C++ shortcomings are an historical artifact, they
> can't be defended on technical grounds (academic or otherwise) alone.
> BTW, I speak as an active C++ programmer who has tried very hard to
> write what you referred to as "elegant, ... reliable, maintainable,
> extensible C++ code".  I've written successful commercial products
> in the language.  C++ filled an important need when I began using it
> in the mid-80s.  15+ years later,

Do you mean that you have no experience with modern C++ (less than 3
years)? The stuff you find in Boost or Alexandrescu's book, for

> it seems to me that C++ needs some major improvements if it is to
> remain a competitive language in the longer term.

I fully agree.

> One important area in which those improvements will need to happen
> is in type safety, perhaps along the lines of something like Safe C
> (http://www.cs.wisc.edu/~austin/scc.html).

For all the things C++ needs, IMHO, better type safety is not the most
urgent. A group of users are pushing for adopting features from the
functional programming field, which would reinforce the multiparadigm
aspect of C++, but the sacred cows that speaked so far are not very
open to the idea :-(

> For all I know, Managed C++ in .NET will be the next big thing, but
> I find myself sort of hoping not...  ;)


[This is getting too off-topic. Although is really interesting to hear
the impressions about C++ the people here have, if you feel this is no
longer appropriate please switch to e-mail.]