Linked by Eugenia Loli-Queru on Mon 18th Jul 2005 03:38 UTC
General Development The rules of C++ are designed to guarantee that type errors are impossible. Casting, however, subverts the type system and can lead to pesky errors in compiled code. This chapter explains why it's a good idea to forgo casting as much as possible in C++.
Thread beginning with comment 5619
To read all comments associated with this story, please click here.
No type errors...
by on Mon 18th Jul 2005 08:02 UTC

Member since:

On one hand we read that:
"type errors are impossible"
but on the other that:
"[..] casts subvert the type system. That can lead to all kinds of trouble"

So - let's conclude - in C++ there are no "errors" but "troubles".

The author does not explain that the "troubles" are result of the wrong language design and not only programmer's style. Many of them are eliminated by modern programming languages (Ada, Eiffel, Oberon).

The author first should read "A Critique of C++" by Ian Joyner and "The Darker Side of C++" by Markku Sakkinen
before making such as funny statements. See:

http://www.kcl.ac.uk/kis/support/cc/fortran/cpp/cpp.html

Marko

RE: No type errors...
by on Mon 18th Jul 2005 09:21 in reply to "No type errors..."
Member since:

You know who the author of this article is? It's Scott Meyer! You'd really have a hard time finding someone more experienced with the language C++ and its intricacies...

Reply Parent Bookmark Score: 1

RE: No type errors...
by on Mon 18th Jul 2005 12:38 in reply to "No type errors..."
Member since:

The author does not explain that the "troubles" are result of the wrong language design and not only programmer's
style. Many of them are eliminated by modern programming languages (Ada, Eiffel, Oberon).


What I absolutely admire about Ada, Eiffel, and Oberon, is that they managed to come become rather powerful and versatile OO languages while maintaining backwards compatibility with the enormous amounts of existing C code What a feat!

Oh wait...

Reply Parent Bookmark Score: 0