home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!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.715000066@thor>
- Date: 28 Aug 92 11:07:46 GMT
- References: <714668024@thor> <6800007@tisdec.tis.tandy.com> <1992Aug26.130335.26725@hemlock.cray.com> <1992Aug26.215600.15114@mksol.dseg.ti.com>
- Sender: news@Rational.COM
- Lines: 39
-
- mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
-
- |In <1992Aug26.130335.26725@hemlock.cray.com> dsf@cray.com (Dan Frankowski) writes:
-
- |I believe someone once wrote an article entitled something like
- |"Structured Programming Using Goto"; the same person who wrote
- |another article that started this whole mess that was entitled "Goto
- |Considered Harmful", if my memory has changed state randomly. In a
- |nutshell, 'goto' isn't the problem; it's the 'come from' that kills
- |you when it comes to figuring out what is going on. If you structure
- |things correctly and document them clearly, there are times when
- |'goto', 'break', AND multiple exits make good sense in making code
- |more easily read.
-
- |>Note that I did not
- |>say gotos have no uses. (I haven't made up my mind yet. Maybe this
- |>thread will help me decide. :-) However, they're not structured
- |>programming, as defined by the debate in computer science fifteen-odd
- |>years ago.
-
- |According to the guy who started that debate they are (if properly
- |used).
-
- Keep in mind that the guy who started that debate (E. W. Dijkstra)
- specified the "proper use of goto" as follows: (And I paraphrase from
- his Notes on Structured Programming, "Structured Programming" Page
- 18-20). Control sequences can be limited to 3 distinguished forms,
- "concatenation", "selection" and "repetition". These forms can be
- describes using flowcharts, these flowchars share the property that
- they have a single entry at the top and a single exit at the bottom.
-
-
-
-
- --
- 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++
-