home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 18055 < prev    next >
Encoding:
Text File  |  1992-12-16  |  5.5 KB  |  141 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!munnari.oz.au!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Subject: Re: Need help implementic data structures of generic objects
  5. Message-ID: <1992Dec16.141341.2554@ucc.su.OZ.AU>
  6. Sender: news@ucc.su.OZ.AU
  7. Nntp-Posting-Host: extro.ucc.su.oz.au
  8. Organization: MAXTAL P/L C/- University Computing Centre, Sydney
  9. References: <1992Dec11.233253.27540@informix.com> <MATT.92Dec11162629@physics.berkeley.edu> <1992Dec13.002551.778@informix.com>
  10. Date: Wed, 16 Dec 1992 14:13:41 GMT
  11. Lines: 128
  12.  
  13. In article <1992Dec13.002551.778@informix.com> cshaver@informix.com (Craig Shaver) writes:
  14. >
  15. >*** WARNING ***
  16. >flame on!
  17. >Another tech weenie C++ bigot speaks out against Object Oriented Programming
  18. >methodology in general!  (no :')
  19. >flame off!
  20.  
  21.     You presumably are the expert in OO Craig? You can resolve
  22. dispute the top people in OO are involved in? Sure you know
  23. what OO actually is? Please tell me, because I dont know exactly.
  24.  
  25. >
  26. >This group seems to be biased against inheritance techniques in all cases.
  27. >
  28.  
  29.     What gave you that strange idea? Is the suggestion
  30. that inheritance is sometimes inappropriate indication of bias?
  31.  
  32.     Of course this group *is* biased about OO, the group
  33. is about C++, not OO. 
  34.  
  35.     C++ supports other styles than OO, and in particular
  36. does not support the dynamic type of OO used in Smalltalk 
  37. very well at all.
  38.  
  39. >
  40. >It is obvious to me that you have a virtual function in the base class for 
  41. >all functions that you need to use when dealing with 'Objects'.
  42.  
  43.     Yes. Exactly. In C++ there is exactly one such function:
  44.  
  45.     virtual ~Object(){}
  46.  
  47. a virtual destructor. This ensures all things derived from Object
  48. are properly deleted, and also allows dummy objects differing
  49. only in their addresses (identities) to be created.
  50.  
  51.     No, you are also wrong, you said "you need to use",
  52. and you should have said "everyone everywhere". The whole
  53. idea is to have reusable components.
  54.  
  55. >
  56. >If you use a function on a class that is only restricted to a certain
  57. >sub-tree of your inheritance structure, then you know what you are using,
  58. >ergo, you should have used that type instead of 'Object'.
  59.  
  60.     So what is the point of class Object, if you never use it?
  61. Because it doenst have any useful methods 
  62. (except a dummy virtual destructor)?
  63.  
  64. >
  65. >IMHO, if you do not use inheritance, you are not doing OOP.  If you do
  66. >not care, then you are just using C++ as a variation on C with no real
  67. >benefit.
  68.  
  69.     Religious drivel. I use inheritance, and I also use
  70. C++ prinicpally as and ADT language, not as an OO one. Thats because
  71. most of the time polymorphism just isnt so important in what I do.
  72. I use it when I think it appropriate.
  73.  
  74.     And I definitely get huge benefits. The biggest benefits
  75. come from
  76.  
  77.     a) my string class, which is entirely concrete,
  78.     and which I have derived specialised classes from
  79.     for purposes of *reuse*, but no polymorphism was involved.
  80.  
  81.     b) My list class (AKA extensible array) which is a template
  82.     and again has no polymorphism.
  83.  
  84. and in both cases I'm using C++ as a smarter C with classes,
  85. as and ADT language, as a procedural language, and I'm
  86. using classes as modules and types---but not using polymorphism.
  87.  
  88. Most of the uses I have for virtual functions involve pure
  89. virtuals in an abstract base, and some implementation(s) of them,
  90. which is really ADT programming not OO.
  91. >
  92. >The tech weenies that like technology for technology's sake are just
  93. >so much useless overhead.  I have seen too many hackers take a good idea
  94. >to extremes and I feel that this is happening wherever C++ is being
  95. >used in a commercial environment.
  96.  
  97.     I thought this a rather good description of what your
  98. own view appeared to be. Isnt it you making OO a God?
  99. >
  100. >The reason commercials are using C++ is because they have heard that OOP
  101. >will save them money and allow them to build more software faster and with
  102. >fewer bodys.  If this does not turn out to be the case then C++ will not
  103. >be used.  
  104.  
  105.     It has already turned out to be the case that C++ is a much,
  106. much, much, much better language than C. Absolutely no programmer
  107. *I* know of with >1 years C++ experience would willingly
  108. go back to C, and some would refuse point blank unless there were
  109. no alternative (I still write assembler .. :-)
  110.  
  111. >The point being that if everyone does not use C++ to build economical
  112. >and reusable solutions then eventually a backlash will occur and it will
  113. >start to get the bad press it deserves.  
  114.  
  115.     Not everyone need be successful. IMHO those using
  116. the Smalltalk model will not be (if they are writing C++, that is).
  117.  
  118. >I think this is starting to
  119. >happen, and I expect to hear something soon out of Borland about this
  120. >subject.
  121.  
  122.     You're kidding yourself. One of the premier compiler
  123. writers deriding their own product?
  124.  
  125. >
  126. >So if you insist on making something more complicated than is needed and
  127. >you do not use good sense and good software engineering practices; it may come
  128. >back to haunt you.  But like most sniveling nerdy tech weenies you will
  129. >be on your way with C++ stamped on your resume.  The last company will
  130. >be trying to sweep the embarrassment you left behind under the rug.
  131.  
  132.     I dont think this will happen, your former analysis was more
  133. correct: companies will use C++ because everyone else is,
  134. without really knowing what benefits it can bring.
  135.  
  136. -- 
  137. ;----------------------------------------------------------------------
  138.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  139.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  140. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  141.