home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / lang / cplus / 18317 < prev    next >
Encoding:
Text File  |  1992-12-22  |  1.8 KB  |  48 lines

  1. Newsgroups: comp.lang.c++
  2. From: nikki@trmphrst.demon.co.uk (Nikki Locke)
  3. Path: sparky!uunet!pipex!demon!trmphrst.demon.co.uk!nikki
  4. Subject: Re: "type safety" deemed essential
  5. Reply-To: nikki@trmphrst.demon.co.uk
  6. Distribution: world
  7. X-Mailer: cppnews $Revision: 1.30 $
  8. Organization: Trumphurst Ltd.
  9. Lines: 34
  10. Date: Tue, 22 Dec 1992 12:44:33 +0000
  11. Message-ID: <725053473snx@trmphrst.demon.co.uk>
  12. Sender: usenet@demon.co.uk
  13.  
  14. In article <448@genie.UUCP> roger@genie.UUCP (Roger H. Scott) writes:
  15. > In article <rmartin.724430168@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
  16. > >For any significant industrial application, I think strong typing is
  17. > >utterly essential.  It is just too easy to create horrible run time
  18. > >errors without type safety.  
  19. > This sounds like theory rather than practice speaking.  Let's hear from the
  20. > (net) C++ user community: who has written a non-trivial commercial C++ 
  21. > application *without* making significant use of either type casting [(T *)]
  22. > or run-time type checking [Bar *bar_p = foo_p->asBar();]?  
  23.  
  24. Does my Text Mode User Interface Toolkit count ?
  25.  
  26. I DID use downcasting, but only as an efficiency hack in templated 
  27. Collections, and all hidden from the caller in the Collection template.
  28.  
  29. I also used a construct VObject *v = editControl->inheritingVObject();
  30. However, this was NOT type-safe downcasting, but used in the following 
  31. inheritance DAG ...
  32.  
  33.    VObject       EditControl
  34.      |              |
  35.      +------+-------+
  36.             |
  37.        Some mixin class (e.g. TextEdit)
  38.  
  39. to enable some function taking a Collection of EditControls to display 
  40. them on the screen (which requires them to be VObjects).
  41.  
  42. The Toolkit is currently approx 16,000 lines of code.
  43.  
  44. -- 
  45. Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
  46. trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
  47.