home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / comp / lang / c / 20004 < prev    next >
Encoding:
Internet Message Format  |  1993-01-21  |  1.3 KB

  1. Xref: sparky comp.lang.c:20004 comp.lang.c++:19656
  2. Newsgroups: comp.lang.c,comp.lang.c++
  3. Path: sparky!uunet!cs.utexas.edu!sun-barr!ames!kronos.arc.nasa.gov!butch!netcomsv!netcom.com!erc
  4. From: erc@netcom.com (Eric Smith)
  5. Subject: Re: discriminated unions (Re: C/C++ Correctness (was: Re: C/C++ Speed))
  6. Message-ID: <1993Jan21.075642.6482@netcom.com>
  7. Organization: Netcom - Online Communication Services (408 241-9760 guest)
  8. References: <TMB.93Jan20160311@arolla.idiap.ch> <1993Jan20.184221.19003@netcom.com> <1993Jan21.004105.1335@ucc.su.OZ.AU>
  9. Date: Thu, 21 Jan 1993 07:56:42 GMT
  10. Lines: 13
  11.  
  12. In article <1993Jan21.004105.1335@ucc.su.OZ.AU> maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes:
  13. >    Later I can write a breadth first search.
  14. >    I dont have to change anything to write the breadth first search.
  15. >    Its just a global function taking the tree as an argument.
  16.  
  17. Ok, now I understand.  You want to be able to add functionality to a class
  18. without changing the class itself nor deriving a new version of it.  Your
  19. discriminated unions would be helpful toward that goal, but I still don't
  20. see any overwhelming advantage of that goal.  The only real advantage I can
  21. see is that you don't have to use a new class name for your new version.
  22.  
  23. Other than cluttering class name space, are there any disadvantages in
  24. deriving new classes to add functionality?
  25.