home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!meaddata!ralpht
- From: ralpht@meaddata.com (Ralph W. Trickey)
- Newsgroups: comp.lang.c++
- Subject: Re: "type safety" deemed essential
- Date: 21 Dec 1992 20:25:37 GMT
- Organization: Mead Data Central, Dayton OH
- Lines: 43
- Distribution: world
- Message-ID: <1h5981INNf9a@meaddata.meaddata.com>
- References: <1992Dec13.141400.5307@mole-end.matawan.nj.us> <1992Dec14.212143.15591@leland.Stanford.EDU> <rmartin.724430168@thor> <448@genie.UUCP>
- NNTP-Posting-Host: retina.meaddata.com
-
- In article <448@genie.UUCP>, 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.
-
- I have written several non-trivial commercial applications.
- Type-casting was required for collection classes because I was writing
- without templates, but it was used solely in accessor functions for
- the collection class. Run-time type information was required for
- persistency, and encapulated in it. I don't anticipate ever needing to
- use these features for more than that. C++ requires a different design
- methodology. If you have to query the object to find out what kind of
- object it is, you may want to re-think your design to find out where
- you lost that information.
-
- I'm sorry, but I still remember the nightmares from programming in
- BASIC and assembler. I don't program in Smalltalk, but from what I
- have heard, it has the potential for the same problems. I want the
- compiler to guarantee that the class can handle the message, and that
- I won't spend days looking for w0rk.<G>
-
- Ralph
-
- --
- Ralph Trickey | (513) 865-6800 |
- Mead Data Central | x4870 | Disclaimer
- P.O. Box 933 | ralpht@meaddata.com | My opinions are my own
- Dayton, Ohio 45401 | ...!uunet!meaddata!ralpht |
-