home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17959 < prev    next >
Encoding:
Internet Message Format  |  1992-12-14  |  4.7 KB

  1. Path: sparky!uunet!gossip.pyramid.com!pyramid!infmx!cshaver
  2. From: cshaver@informix.com (Craig Shaver)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Need help implementic data structures of generic objects
  5. Message-ID: <1992Dec13.002551.778@informix.com>
  6. Date: 13 Dec 92 00:25:51 GMT
  7. References: <1992Dec10.114636.16861@ucc.su.OZ.AU> <1992Dec11.233253.27540@informix.com> <MATT.92Dec11162629@physics.berkeley.edu>
  8. Sender: news@informix.com (Usenet News)
  9. Organization: Informix Software, Inc.
  10. Lines: 92
  11.  
  12. In article <MATT.92Dec11162629@physics.berkeley.edu> matt@physics.berkeley.edu writes:
  13. >In article <1992Dec11.233253.27540@informix.com> cshaver@informix.com (Craig Shaver) writes:
  14. >
  15. >> >>class Object {
  16. >> >>    /* ...etc... */
  17. >> >>};
  18. >> >
  19. >> >    Dont do this Smalltalk hack please. A queue of Objects is
  20. >> >totally useless, since they are just Objects and not ever Widgets.
  21. >> 
  22. >> YES! Do that elegant Smalltalk thing.  Do not listen to C++ hacks and
  23. >> bigots.  Put a little thought into it and do something (re)useful.
  24. >
  25. >The problem is that in C++, as opposed to Smalltalk, this *isn't*
  26. >terribly elegant.  The question is: what can you do with an Object?
  27. >If you put a Widget into a list of Objects, you can't call any of the
  28. >Widget member functions; you can only call the Object member
  29. >functions.
  30. >
  31. >You can, of course, access the Widget member functions by downcasting
  32. >the Object* to a Widget*, but I would scarcely call that elegant.
  33. >(Also, of course, you're deliberately violating the language's type
  34. >checking, so you're opening yourself up to all sorts of fun bugs.)  I
  35. >would suggest that if your program makes heavy use of downcasting,
  36. >then you are probably not using the best possible design.
  37. >
  38. >There probably are some programs for which Smalltalk is a better
  39. >choice of language than C++.  For those programs, the simple solution
  40. >is just to use Smalltalk; as Dr. Stroustrup has pointed out, Smalltalk
  41. >does a far better job of being Smalltalk than C++ ever will.
  42. >--
  43. >Matthew Austern                   Just keep yelling until you attract a
  44. >(510) 644-2618                    crowd, then a constituency, a movement, a
  45. >austern@lbl.bitnet                faction, an army!  If you don't have any
  46. >matt@physics.berkeley.edu         solutions, become a part of the problem!
  47.  
  48. *** WARNING ***
  49. flame on!
  50. Another tech weenie C++ bigot speaks out against Object Oriented Programming
  51. methodology in general!  (no :')
  52. flame off!
  53.  
  54. This group seems to be biased against inheritance techniques in all cases.
  55.  
  56. Matthew is going through the physics department of berserkeley, so I have
  57. to assume we are dealing with a person of intelligence.  That is unless
  58. the night janitor has an interest in C++ class libraries.
  59.  
  60. It is obvious to me that you have a virtual function in the base class for 
  61. all functions that you need to use when dealing with 'Objects'.
  62.  
  63. If you use a function on a class that is only restricted to a certain
  64. sub-tree of your inheritance structure, then you know what you are using,
  65. ergo, you should have used that type instead of 'Object'.
  66.  
  67. IMHO, if you do not use inheritance, you are not doing OOP.  If you do
  68. not care, then you are just using C++ as a variation on C with no real
  69. benefit.
  70.  
  71. The tech weenies that like technology for technology's sake are just
  72. so much useless overhead.  I have seen too many hackers take a good idea
  73. to extremes and I feel that this is happening wherever C++ is being
  74. used in a commercial environment.
  75.  
  76. The reason commercials are using C++ is because they have heard that OOP
  77. will save them money and allow them to build more software faster and with
  78. fewer bodys.  If this does not turn out to be the case then C++ will not
  79. be used.  The point being that if everyone does not use C++ to build economical
  80. and reusable solutions then eventually a backlash will occur and it will
  81. start to get the bad press it deserves.  I think this is starting to
  82. happen, and I expect to hear something soon out of Borland about this
  83. subject.
  84.  
  85. So if you insist on making something more complicated than is needed and
  86. you do not use good sense and good software engineering practices; it may come
  87. back to haunt you.  But like most sniveling nerdy tech weenies you will
  88. be on your way with C++ stamped on your resume.  The last company will
  89. be trying to sweep the embarrassment you left behind under the rug.
  90.  
  91. This posting does not begin to express my full feelings on this matter.
  92. I suspect that it will fall on deaf ears, and it may ramble a bit.
  93. But it make me feel good to write.
  94.  
  95. Please; in all of the above, correct me if I have been technically
  96. wrong, and then explain your philisophical counter point to the
  97. use of inheritance.
  98.  
  99. If I offended anyone that is just tough.
  100.  
  101. -- 
  102. Craig Shaver  (cshaver@informix.com for now) (415)390-0654 (415)926-6407
  103. Productivity Group POB 60458 Sunnyvale, CA  94088
  104.