home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- 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
- From: maxtal@extro.ucc.su.OZ.AU (John MAX Skaller)
- Subject: Re: Criticisms Wanted
- Message-ID: <1992Nov16.142636.7721@ucc.su.OZ.AU>
- Sender: news@ucc.su.OZ.AU
- Nntp-Posting-Host: extro.ucc.su.oz.au
- Organization: MAXTAL P/L C/- University Computing Centre, Sydney
- References: <BxGu0p.D3o@slipknot.rain.com> <1992Nov14.145013.9856@ucc.su.OZ.AU> <24194@alice.att.com>
- Date: Mon, 16 Nov 1992 14:26:36 GMT
- Lines: 36
-
- In article <24194@alice.att.com> bs@alice.att.com (Bjarne Stroustrup) writes:
- >
- >
- >maxtal@extro.ucc.su.OZ.AU (John MAX Skaller) writes
- >
- > > Well, Eiffel has class invariants, and these go some way towards
- > > providing semantics. Apparently quite a lot of errors in Eiffel are
- > > caught by invariant failures, such errors cannot be trapped by the
- > > system in C++ because it doesnt have invariants (or post/pre-conditions).
- >
- >Note that assertions and invariant checking are old techniques and can
- >be applied in C++. C programmers have used the assert macro for more
- >than a decade and many C++ programmers use a some invariant checking
- >technique. For example, see sec12.2.7 (pp416-420) of ``The C++ Programming
- >Language (2nd edition).''
-
- Making C++ equivalents requires manual enforcement of
- idioms. It is not so easy I think, for example, to implement
- preconditions for functions, since the precondition ought to
- be checked at the point of call, not on entry to the caller.
-
- It is perhaps premature to standardise the nice A++ syntax,
- but it is worth looking at. I feel lack of invariants/logic
- (somewhat compensated for by exception specifications) and GC
- are the two major defects of C++ cf Eiffel.
-
- There is probably no hope for GC, but a proper assertional
- facility should be introduced at some stage. Note that preconditions,
- for example, are really just 'extra-strong' typing, i.e. within
- the current philosophy of C++.
-
- --
- ;----------------------------------------------------------------------
- JOHN (MAX) SKALLER, maxtal@extro.ucc.su.oz.au
- Maxtal Pty Ltd, 6 MacKay St ASHFIELD, NSW 2131, AUSTRALIA
- ;--------------- SCIENTIFIC AND ENGINEERING SOFTWARE ------------------
-