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 na
- Message-ID: <1992Aug26.215600.15114@mksol.dseg.ti.com>
- Organization: Texas Instruments Inc
- References: <714668024@thor> <6800007@tisdec.tis.tandy.com> <1992Aug26.130335.26725@hemlock.cray.com>
- Date: Wed, 26 Aug 1992 21:56:00 GMT
- Lines: 52
-
- In <1992Aug26.130335.26725@hemlock.cray.com> dsf@cray.com (Dan Frankowski) writes:
-
- >In article <6800007@tisdec.tis.tandy.com> kevinl@tisdec.tis.tandy.com writes:
-
- >> 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), ..
-
- >I thought that one of the triumphs of the Structured Programming camp
- >was an honest-to-goodness proof that any code using gotos could be
- >replaced by structured constructs and state variables. I can imagine
- >some such proof by construction from arbitrary code with a goto.
-
- The fact that you CAN do something is not necessarily adequate proof
- that you SHOULD do something. Yes, you can do anything you like with
- 'if-then' and 'while'. Even structured programmers use other
- constructs than those. You should use what makes things clearest, and
- yes, there are going to be times when 'goto' and 'break' make for
- cleaner and more easily read code.
-
- >> 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.
-
- >If one-entry-one-exit is part of a structured programming, then the
- >goto is not "just another structured technique."
-
- 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).
-
-
- --
- "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.
-