home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18091 < prev    next >
Encoding:
Text File  |  1992-12-16  |  2.9 KB  |  66 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: Need help implementic data structures of generic objects
  5. Reply-To: nikki@trmphrst.demon.co.uk
  6. Distribution: world
  7. X-Mailer: cppnews $Revision: 1.30 $
  8. Organization: Trumphurst Ltd.
  9. Lines: 52
  10. Date: Tue, 15 Dec 1992 20:29:18 +0000
  11. Message-ID: <724476558snx@trmphrst.demon.co.uk>
  12. Sender: usenet@demon.co.uk
  13.  
  14. In article <1992Dec13.002551.778@informix.com> cshaver@informix.com (Craig Shaver) writes:
  15. > Another tech weenie C++ bigot speaks out against Object Oriented Programming
  16. > methodology in general!  (no :')
  17.  
  18. No, the various C++ programmers who have replied to your rantings have 
  19. merely stated that C++ is not the best language to implement a particular 
  20. design, viz. heterogeneous collections.
  21.  
  22. > This group seems to be biased against inheritance techniques in all cases.
  23.  
  24. No, this group merely states that heterogeneous collections (and certain 
  25. other things) are difficult to implement in statically typed languages 
  26. like C++, because they are incompatible with static typing.
  27.  
  28. > Matthew is going through the physics department of berserkeley, so I have
  29. > to assume we are dealing with a person of intelligence.  That is unless
  30. > the night janitor has an interest in C++ class libraries.
  31.  
  32. No-one was insulting Matthew's intelligence. I take it you are the night 
  33. janitor at Informix :-) [ Sorry, couldn't resist. I'm sure you are highly 
  34. intelligent really, it is just that your postings do not make it obvious ].
  35.  
  36. > It is obvious to me that you have a virtual function in the base class for 
  37. > all functions that you need to use when dealing with 'Objects'.
  38.  
  39. This is the major problem with such systems - you end up with hundreds of 
  40. virtual functions in the base Object, most of which will not be used 
  41. (indeed, have no meaning) in a particular derived class. It can work, but 
  42. it is not elegant C++.
  43.  
  44. > If you use a function on a class that is only restricted to a certain
  45. > sub-tree of your inheritance structure, then you know what you are using,
  46. > ergo, you should have used that type instead of 'Object'.
  47.  
  48. Correct. That is what everyone else is saying too.
  49.  
  50. > So if you insist on making something more complicated than is needed and
  51. > you do not use good sense and good software engineering practices; it may come
  52. > back to haunt you.  
  53.  
  54. Precisely what everyone else is saying. Deriving everything from Object 
  55. _is_ making things too complicated.
  56.  
  57. And as for inheritance, in C++ it is for expressing an "is-a" 
  58. relationship. Templates are for expressing genericity.
  59.  
  60. [ Remind me to avoid the first few versions of any C++ class libraries 
  61. that Informix come up with. Or was your disclaimer missing :-]
  62.  
  63. -- 
  64. Nikki Locke,Trumphurst Ltd.(PC and Unix consultancy) nikki@trmphrst.demon.co.uk
  65. trmphrst.demon.co.uk is NOT affiliated with ANY other sites at demon.co.uk.
  66.