home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!kithrup!hoptoad!decwrl!mips!swrinde!zaphod.mps.ohio-state.edu!usc!news.bbn.com!news.bbn.com!brazile
- From: brazile@soir.bbn.com (Robert Brazile)
- Newsgroups: comp.lang.c++
- Subject: Re: Return value for the constructors.
- Message-ID: <BRAZILE.92Aug20170044@soir.bbn.com>
- Date: 20 Aug 92 22:00:44 GMT
- References: <1992Aug19.163545.25066@sunb10.cs.uiuc.edu>
- <1992Aug19.175852.38459@watson.ibm.com>
- <1992Aug19.231926.28218@sunb10.cs.uiuc.edu>
- <2273@devnull.mpd.tandem.com> <matt.714318343@centerline.com>
- <1992Aug20.170524.3452@sunb10.cs.uiuc.edu>
- <matt.714332315@centerline.com>
- Distribution: usa
- Organization: Bolt Beranek and Newman, Cambridge, Mass.
- Lines: 32
- NNTP-Posting-Host: soir.bbn.com
- In-reply-to: matt@centerline.com's message of 20 Aug 92 17:38:35 GMT
-
- In article <matt.714332315@centerline.com> matt@centerline.com (Matt Landau) writes:
- [Also, having worked on a large software system that used exceptions as
- a primary means of error reporting and recovery, I'm not convinced that
- it's the panacea some people seem to think it will be. Dealing with
- exceptions correctly in large systems rapidly becomes tedious and error
- prone itself.]
-
- Having worked on the large software system to which Matt refers, I can
- verify what he says. In particular, reuse becomes tricky in that the
- piece of code you steal^H^H^H^H^Hreuse (or just call from a library)
- may surprise you - even if the exceptions it throws are documented and
- you've covered them, code upon which it depends might throw exceptions that
- it doesn't handle for you. If they're uncommon enough, you might not
- find out for a long time. Which means you pass that problem on to any
- code that calls your new routine.
-
- That shouldn't happen in well-designed code, I hear you cry. Well,
- that's true, but in a large and/or complex system it WILL happen.
-
- Having exceptions is no worse than the current situation (trying to do
- everything by returning NULL pointers, or [shudder] global error
- codes) and is actually preferable because it's more flexible and helps
- with signalling errors in (hopefully simple) constructors. I just want
- to point out that it's not a panacea - it's doesn't even make things
- particularly easier.
-
- Robert Brazile
- Bolt Beranek and Newman
- --
- Robert Brazile brazile@bbn.com
- Bolt Beranek and Newman Inc. +1 (617) 873-2403
- Cambridge, Massachusetts
-