home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / cplus / 17856 < prev    next >
Encoding:
Text File  |  1992-12-12  |  2.6 KB  |  58 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: Give me safe C++
  5. Message-ID: <1992Dec12.145403.26483@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: <9234501.15945@mulga.cs.mu.OZ.AU> <Bz2nDF.7B6@fiu.edu> <WARSAW.92Dec11124441@anthem.nlm.nih.gov>
  10. Date: Sat, 12 Dec 1992 14:54:03 GMT
  11. Lines: 45
  12.  
  13. In article <WARSAW.92Dec11124441@anthem.nlm.nih.gov> warsaw@nlm.nih.gov (Barry A. Warsaw) writes:
  14. >
  15. >>>>>> "Michael" == Michael Feathers <feathers@serss0> writes:
  16. >
  17. >    Michael> The Ada people had the best of intentions, I'm sure, but
  18. >    Michael> I think that C and C++ are versatile languages precisely
  19. >    Michael> because no one ever tried to limit their functionality
  20. >    Michael> with good intentions.
  21. >
  22. >Agreed. IMHO, the real power of C++ as a development language is the
  23. >ability to easily climb up and down the abstraction ladder depending
  24. >on the context of the problem.  Sometimes you need to mingle with the
  25. >bits in the basement, sometimes you just need ADTs and sometimes you
  26. >really want to do OOP.  The beauty of C++ is that it seamlessly
  27. >supports many levels of abstraction.
  28.  
  29.     While tending to support your liking of the C++ 'hybrid'
  30. approach, I'm not so sure about 'seamlessly', are you?
  31.  
  32.     And I think you tend to miss exactly where rigid restrictions
  33. on functionality are the things which *yield* the very power you desire.
  34. For example, virtual functions can be trivially implemented
  35. using function pointers. Function pointers in fact are a vastly
  36. more powerful technique than mere virtual functions. 
  37.  
  38.     What makes virtual functions so useful is the fact that they
  39. are so tightly restricted .. for example, unlike a genuine
  40. function pointer they cannot be modified after object creation,
  41. nor specialised on a per object basis.
  42.  
  43.     So when language designers propose restrictions, one must
  44. carefully weigh up the pros and cons: most restrictions also
  45. grant freedom. In the case of virtual functions, if your
  46. program compiles and links they are sure to be properly initialised,
  47. freeing you from checking this manually. Inadvertant execution
  48. of uninitialised function pointers does result in interesting
  49. problems for those who enjoy debugging though.
  50.  
  51.  
  52.  
  53. -- 
  54. ;----------------------------------------------------------------------
  55.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  56.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  57. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  58.