home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / lang / cplus / 16377 < prev    next >
Encoding:
Text File  |  1992-11-17  |  2.3 KB  |  49 lines

  1. Newsgroups: comp.lang.c++
  2. Path: sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!munnari.oz.au!mel.dit.csiro.au!mineng.dmpe.CSIRO.AU!dmssyd.syd.dms.CSIRO.AU!metro!extro.ucc.su.OZ.AU!maxtal
  3. From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
  4. Subject: Re: Criticisms Wanted
  5. Message-ID: <1992Nov16.142636.7721@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: <BxGu0p.D3o@slipknot.rain.com> <1992Nov14.145013.9856@ucc.su.OZ.AU> <24194@alice.att.com>
  10. Date: Mon, 16 Nov 1992 14:26:36 GMT
  11. Lines: 36
  12.  
  13. In article <24194@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:
  14. >
  15. >
  16. >maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes
  17. >
  18. > >     Well, Eiffel has class invariants, and these go some way towards
  19. > > providing semantics. Apparently quite a lot of errors in Eiffel are 
  20. > > caught by invariant failures, such errors cannot be trapped by the
  21. > > system in C++ because it doesnt have invariants (or post/pre-conditions).
  22. >
  23. >Note that assertions and invariant checking are old techniques and can
  24. >be applied in C++. C programmers have used the assert macro for more
  25. >than a decade and many C++ programmers use a some invariant checking
  26. >technique. For example, see sec12.2.7 (pp416-420) of ``The C++ Programming
  27. >Language (2nd edition).''
  28.  
  29.     Making C++ equivalents requires manual enforcement of
  30. idioms. It is not so easy I think, for example, to implement
  31. preconditions for functions, since the precondition ought to
  32. be checked at the point of call, not on entry to the caller.
  33.  
  34.     It is perhaps premature to standardise the nice A++ syntax,
  35. but it is worth looking at. I feel lack of invariants/logic
  36. (somewhat compensated for by exception specifications) and GC
  37. are the two major defects of C++ cf Eiffel.
  38.  
  39.     There is probably no hope for GC, but a proper assertional
  40. facility should be introduced at some stage. Note that preconditions,
  41. for example, are really just 'extra-strong' typing, i.e. within
  42. the current philosophy of C++.
  43.  
  44. -- 
  45. ;----------------------------------------------------------------------
  46.         JOHN (MAX) SKALLER,         maxtal@extro.ucc.su.oz.au
  47.     Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
  48. ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
  49.