[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: Strong Typing, Dynamic Languages, What to do?
Oscar,
We seem to have staked out our respective positions fairly predictably.
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. You've pointed out
that you can use C++ features to program in a more typesafe way, by building
your own abstractions and avoiding basic built-in C++ features like native
array dereferencing. But why are you doing this? Because the type system
of C++ is broken, and you're trying to fix it. And that's the point: it's
broken, and needs to be fixed.
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. Like assembly language, though, this
role becomes increasingly marginalized as safer languages match or exceed
the efficiency of C++. 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, it seems to me that C++ needs some major improvements if it is to
remain a competitive language in the longer term. 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 I know, Managed C++ in
.NET will be the next big thing, but I find myself sort of hoping not... ;)
Anton