home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!rational.com!thor!rmartin
- From: rmartin@thor.Rational.COM (Bob Martin)
- Subject: Re: "type safety" deemed essential
- Message-ID: <rmartin.725046114@thor>
- Sender: news@rational.com
- Organization: Rational
- References: <1992Dec13.141400.5307@mole-end.matawan.nj.us> <1992Dec14.212143.15591@leland.Stanford.EDU> <rmartin.724430168@thor> <448@genie.UUCP>
- Date: Tue, 22 Dec 1992 17:41:54 GMT
- Lines: 41
-
- roger@genie.UUCP (Roger H. Scott) writes:
-
- |In article <rmartin.724430168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- |>kocks@leland.Stanford.EDU (Peter Kocks) writes:
- |>
- |>>My $0.02. Use Obj-C. I have just spent a fair amount of time
- |>>comparing strong vs weak type casting systems [...]
- |>
- |>For any significant industrial application, I think strong typing is
- |>utterly essential. It is just too easy to create horrible run time
- |>errors without type safety.
-
- |This sounds like theory rather than practice speaking. Let's hear from the
- |(net) C++ user community: who has written a non-trivial commercial C++
- |application *without* making significant use of either type casting [(T *)]
- |or run-time type checking [Bar *bar_p = foo_p->asBar();]? I maintain that
- |C++ makes it *very* difficult to do without at least one or the other of these
- |(Eiffel-style "anchored" virtual function return types would go a long way to
- |alleviate this). I'm hoping that templates will help in this regard, but they
- |haven't been available long enough to judge.
-
- There is no theory involved in the "horrible run time errors"
- description above. I have spent many years writing C code and
- experiencing those errors. There is also no theory involved in the
- reduction in those errors caused by strong typing. Believe me, I have
- had plenty of, as you say, "practice".
-
- Granted it is very difficult to create a large scale C++ application
- without using some type casting. There are a number of reasons for
- this. One of the most significant is contravariant return types.
- However, the standards committee has accepted covariant return types
- from virtual functions, so this source of typecasts will dissapear.
-
- However, I am confused by your statement. What does typecasting have
- to do with the need for strong typing in industrial languages???
-
- --
- Robert Martin Training courses offered in:
- R. C. M. Consulting Object Oriented Analysis
- 2080 Cranbrook Rd. Object Oriented Design
- Green Oaks, Il 60048 (708) 918-1004 C++
-