home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!cs.utexas.edu!csc.ti.com!tilde.csc.ti.com!mksol!mccall
- From: mccall@mksol.dseg.ti.com (fred j mccall 575-3539)
- Subject: Re: GOTO, was: Tiny proposal for named loops.
- Message-ID: <1992Sep11.184207.15187@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <2318@devnull.mpd.tandem.com> <rmartin.715001372@thor> <4192@papaya.bbn.com> <1992Sep2.131733.20676@terminator.cc.umich.edu> <r <KERS.92Sep4082931@cdollin.hpl.hp.com> <rmartin.715618743@thor> <1992Sep9.210632.25891@mksol.dseg.ti.com> <rmartin.716170143@thor>
- Date: Fri, 11 Sep 1992 18:42:07 GMT
- Lines: 39
-
- In <rmartin.716170143@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
-
- >mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
-
- >|In <rmartin.715618743@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
-
- >|Sorry, but that's hardly the reason. Where is the 'coupling' or the
- >|difficulty in maintenance when goto is used for things like error
- >|handling or error returns?
-
- >The coupling is between the error condition, and the error processing.
- >The error processing control flow is merged with the separate control
- >flows which detect the error.
-
- And just how, pray tell, do you recover from an error WITHOUT coupling
- between the error condition and the error processing, since what error
- processing you need to do is most certainly going to be dependent on
- what your error condition is?
-
- >These merged control flows get difficult to maintain over time,
- >because new error conditions arise which need to be handled in almost
- >the same way, but with a few exceptions. These exceptions accumulate
- >in the merged code, and it eventually turns into a nightmare until
- >someone undoes all the gotos and separates all the error processing.
-
- So instead you do WHAT? I don't see any better solution, other than
- duplicating huge blocks of code to do error handling at each test on
- the way through the code (in the other arm of the 'if'). If you are
- also following another one of those guides that often becomes a goal
- in itself (function size limits) you rapidly reach the point (with all
- that duplicated code for error handling) where you can no longer even
- write the function. There's another one of those rules (depth of
- nesting) that will 'kill' your method, as well.
-
- --
- "Insisting on perfect safety is for people who don't have the balls to live
- in the real world." -- Mary Shafer, NASA Ames Dryden
- ------------------------------------------------------------------------------
- Fred.McCall@dseg.ti.com - I don't speak for others and they don't speak for me.
-