home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!UB.com!igor!thor!rmartin
- From: rmartin@thor.Rational.COM (Bob Martin)
- Newsgroups: comp.lang.c++
- Subject: Re: GOTO, was: Tiny proposal for na
- Message-ID: <rmartin.714863091@thor>
- Date: 26 Aug 92 21:04:51 GMT
- References: <714668024@thor> <6800007@tisdec.tis.tandy.com>
- Sender: news@Rational.COM
- Lines: 45
-
- kevinl@tisdec.tis.tandy.com writes:
-
-
- | I have to paritally disagree. Everytime you add a flag variable,
- |you are doubling the number of states for your program. The more states,
- |the more possible paths, and the more paths, the more possible unforseen
- |errors (if the paths are not anticipated and tested--something that is
- |very hard to do).
-
- No, the influence of state variables which control loops is limitted
- to the loop condition, and possibly to tests at the completion of the
- loop. Thus, the "doubling" does not occur.
-
- | For experienced programmers, the goto is a legitamite tactic.
- |There may not be any cases where a goto is absolutly necessary (I've
- |heard that there are some, but I have yet to see any), but putting
- |a goto instead of, say, another function call in a path that is called
- |10,000 times each time the program is run, saves massive amounts of
- |time.
-
- Experience is not a license for abuse. It is the code of the
- inexperienced programmers that is hard to read. The more experienced
- the programmer, the easier his code ought to be to read and maintain,
- even by the inexperienced.
-
- I disagree that goto is a tool for the "experienced" instead I view it
- as an error of the inexperienced.
-
- | I agree that programs are generally easier to understand and
- |debug when there are no goto statements, but, if well documented
- |gotos are just another structured technique.
-
- Oh, I agree that you can write "harmless" gotos. But the point is
- that you don't have to. A goto is never truly necessary.
- Occationally, (very very occationally) you might find a use for a goto
- that is actually justified. But in the last 15 years, I have found
- only one, and that was at 2 in the morning after working a few 70 hour
- weeks. In retrospect, the justification might have been based more on
- fatigue than fact.
-
- --
- Robert Martin Training courses offered in:
- R. C. M. Consulting Object Oriented Analysis
- 2080 Cranbrook Rd. Object Oriented Design
- Green Oaks, Il 60048 (708) 918-1004 C++
-