home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.c++
- Path: sparky!uunet!haven.umd.edu!darwin.sura.net!wupost!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 na
- Message-ID: <1992Sep1.192043.16224@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <714668024@thor> <6800007@tisdec.tis.tandy.com> <1992Aug26.130335.26725@hemlock.cray.com> <1992Aug26.194538.1598@spss.com> <rmartin.714931485@thor>
- Date: Tue, 1 Sep 1992 19:20:43 GMT
- Lines: 33
-
- In <rmartin.714931485@thor> rmartin@thor.Rational.COM (Bob Martin) writes:
-
- >So we have rules. These rules protect us average types from the guys
- >who think they are "real good drivers". When some guy blows a stop
- >sign, it doesn't matter to me, one whit, if he is the greatest driver
- >in the world, I will still applaud the cop who pulls him over.
-
- But the problem is that, all too often, we lose sight of what we
- wanted the rule to do for us and the means BECOMES the goal. I've
- seen this more times than I care to mention when it comes to 'rules'
- and their 'enforcement'.
-
- The real rule on 'goto' ought to be something like, "Presence of a
- goto in code MAY indicate poorly structured and/or overly complex
- code. Any use of a goto should be carefully examined to determine if
- there are not better alternative structures which will be more easily
- understood and maintained by others. If, and only if, this is the
- case, use a 'goto'." Clearly document the purpose and effect of the
- jump at both the 'goto' and 'label'. Avoid jumps from different
- places to the same label. Similar rules for various other
- 'questionable' or 'abused' constructs.
-
- The argument, "Well, you never NEED to use a goto." is hardly a
- justification for not using them, either. You can also write
- everything in the world (wrt 'structure') with only a conditional test
- and a jump. That's hardly a good reason to say that you SHOULD.
-
-
- --
- "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.
-