home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / cplus / 13007 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  2.1 KB

  1. Path: sparky!uunet!igor!thor!rmartin
  2. From: rmartin@thor.Rational.COM (Bob Martin)
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: GOTO, was: Tiny proposal for na
  5. Message-ID: <rmartin.715000066@thor>
  6. Date: 28 Aug 92 11:07:46 GMT
  7. References: <714668024@thor> <6800007@tisdec.tis.tandy.com> <1992Aug26.130335.26725@hemlock.cray.com> <1992Aug26.215600.15114@mksol.dseg.ti.com>
  8. Sender: news@Rational.COM
  9. Lines: 39
  10.  
  11. mccall@mksol.dseg.ti.com (fred j mccall 575-3539) writes:
  12.  
  13. |In <1992Aug26.130335.26725@hemlock.cray.com> dsf@cray.com (Dan Frankowski) writes:
  14.  
  15. |I believe someone once wrote an article entitled something like
  16. |"Structured Programming Using Goto"; the same person who wrote
  17. |another article that started this whole mess that was entitled "Goto
  18. |Considered Harmful", if my memory has changed state randomly.  In a
  19. |nutshell, 'goto' isn't the problem; it's the 'come from' that kills
  20. |you when it comes to figuring out what is going on.  If you structure
  21. |things correctly and document them clearly, there are times when
  22. |'goto', 'break', AND multiple exits make good sense in making code
  23. |more easily read.
  24.  
  25. |>Note that I did not
  26. |>say gotos have no uses.  (I haven't made up my mind yet.  Maybe this
  27. |>thread will help me decide.  :-) However, they're not structured
  28. |>programming, as defined by the debate in computer science fifteen-odd
  29. |>years ago.
  30.  
  31. |According to the guy who started that debate they are (if properly
  32. |used). 
  33.  
  34. Keep in mind that the guy who started that debate (E. W. Dijkstra)
  35. specified the "proper use of goto" as follows: (And I paraphrase from
  36. his Notes on Structured Programming, "Structured Programming" Page
  37. 18-20).  Control sequences can be limited to 3 distinguished forms,
  38. "concatenation", "selection" and "repetition".  These forms can be
  39. describes using flowcharts, these flowchars share the property that
  40. they have a single entry at the top and a single exit at the bottom.
  41.  
  42.  
  43.  
  44.  
  45. --
  46. Robert Martin                        Training courses offered in:
  47. R. C. M. Consulting                       Object Oriented Analysis
  48. 2080 Cranbrook Rd.                        Object Oriented Design
  49. Green Oaks, Il 60048 (708) 918-1004       C++
  50.