home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!saimiri.primate.wisc.edu!ames!olivea!mintaka.lcs.mit.edu!ai-lab!life.ai.mit.edu!tmb
- From: tmb@arolla.idiap.ch (Thomas M. Breuel)
- Newsgroups: comp.lang.c++
- Subject: Re: feedback wanted on appropriate OOPL
- Message-ID: <TMB.93Jan12172611@arolla.idiap.ch>
- Date: 13 Jan 93 01:26:11 GMT
- References: <726278910snx@trmphrst.demon.co.uk> <rmartin.726674455@thor>
- <TMB.93Jan10170408@arolla.idiap.ch> <1993Jan10.220917.22879@netcom.com>
- <TMB.93Jan11010738@arolla.idiap.ch> <rmartin.726795534@thor>
- Reply-To: tmb@idiap.ch
- Organization: IDIAP (Institut Dalle Molle d'Intelligence Artificielle
- Perceptive)
- Lines: 52
- NNTP-Posting-Host: arolla.idiap.ch
- In-reply-to: rmartin@thor.Rational.COM's message of Mon, 11 Jan 1993 23:38:54 GMT
-
- In article <rmartin.726795534@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
-
- tmb@arolla.idiap.ch (Thomas M. Breuel) writes:
-
- |Detecting errors at compile time is better than detecting them
- |at runtime. But detecting errors at runtime is better than not
- |detecting them at all.
-
- |Unfortunately, the majority of errors that are detectable at all can
- |only be detected at runtime.
-
- I disagree with this statement. In my experience, the majority of
- detectable errors, are detected in the compilation phase (and in the
- code review phase of course).
-
- Array bounds violation, bad pointers, and type errors involving type
- unions, are all detectable errors, but for most algorithms and
- programs, they are not detectable at compile time.
-
- From a practical point of view, I have used languages that have much
- stricter compile time error checking than C++, and they still need a
- lot of runtime checks.
-
- | C++ has no support for runtime error
- |checking,
-
- Although there are common environments that provide it.
-
- These "common environments" have a significant overhead, making them
- useless for production use (if you are willing to accept that kind of
- overhead, you would be better served with another language).
- Furthermore, even for debugging some kinds of applications, they are
- too slow to get your code to the point where the bug occurs.
-
- This I doubt. I think it is more that some runtime features are
- expensive, period. Languages that support them, have made a different
- tradeoff than that made in C++, and have sacrificed something else
- (probably speed) thereby.
-
- Well, we'll just have to see. All the attempts of supporting safety in
- C++ that I have seen (Purify, ObjectCenter, user-defined classes,
- various GC implementations) have had much more overhead for supporting
- those features than other languages.
-
- In any case, it's not an "either/or" situation. You can support safety
- features like array bounds checking etc. and let the user
- enable/disable it for specific sections of code. The only reason why
- this isn't a realistic approach in C++ is for reasons of backwards
- compatibility with C, not because the C++ approach is somehow "more
- efficient".
-
- Thomas.
-