home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- From: nikki@trmphrst.demon.co.uk (Nikki Locke)
- Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
- Subject: Re: "type safety" deemed essential
- Reply-To: nikki@trmphrst.demon.co.uk
- Distribution: world
- X-Mailer: cppnews $Revision: 1.30 $
- Organization: Trumphurst Ltd.
- Lines: 34
- Date: Tue, 22 Dec 1992 12:44:33 +0000
- Message-ID: <725053473snx@trmphrst.demon.co.uk>
- Sender: usenet@demon.co.uk
-
- In article <448@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
- > In article <rmartin.724430168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
- > >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();]?
-
- Does my Text Mode User Interface Toolkit count ?
-
- I DID use downcasting, but only as an efficiency hack in templated
- Collections, and all hidden from the caller in the Collection template.
-
- I also used a construct VObject *v = editControl->inheritingVObject();
- However, this was NOT type-safe downcasting, but used in the following
- inheritance DAG ...
-
- VObject EditControl
- | |
- +------+-------+
- |
- Some mixin class (e.g. TextEdit)
-
- to enable some function taking a Collection of EditControls to display
- them on the screen (which requires them to be VObjects).
-
- The Toolkit is currently approx 16,000 lines of code.
-
- --
- Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
- trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
-