>>>>> "SF" == Shlomi Fish <shlo...@iglu.org.il> writes:

  SF> On Thursday 14 Apr 2011 09:15:35 Uri Guttman wrote:
  >> >>>>> "PS" == Peter Scott <pe...@psdt.com> writes:

  PS> Here is the definitive explanation:
  >> http://www.cs.utexas.edu/users/EWD/ PS> ewd02xx/EWD215.PDF .
  >> 
  >> having heard about that article for many years it was interesting to
  >> read it. it may be over the head of some members here but useful to read
  >> anyway. it doesn't go into any practical reasons why goto is bad. it
  >> just says the logical complexity (his index data) goes way up with gotos
  >> but stays reasonable with high level flow controls
  >> (if/else/while/sub/etc.).
  >> 

  SF> Quoting my post:

  SF> [QUOTE]

  SF> The entire "GOTO statement considered harmful" is quite a
  SF> myth. Granted, Dijkstra wrote an article with this title, and many
  SF> people agreed with him.  But, on the other hand, some people have
  SF> demonstrated that it is possible to do structured programming with
  SF> goto statements, and sometimes even better with them than without
  SF> them.

demonstrations don't mean a thing. i did tons of assembler coding and
was even object oriented and my goto use was cleaner than most high
level coders. i still wouldn't want to go back to that.

  SF> For example, Don Knuth wrote an article "Structured Programming
  SF> Using Goto Statements" (rumouredly sub-titled "'Goto Statement
  SF> Considered Harmful' Considered Harmful") in which he deomnstrated
  SF> exactly that. And I take this view as well.

knuth was making more of a joke with that. also he is knuth. you are not
knuth. 


  SF> Don't get me wrong, I don't advocate a goto-spaghetti, like I once
  SF> saw in old BASIC programs. But goto's have their use.

wrong. especially wrong for newbies. even more wrong for newbies
learning perl.

  SF> When programming in C, I find myself using goto's whenever I feel
  SF> the need to.  This occurs less in Perl where I have other powerful
  SF> constructs.

then you don't know how to code well in c. it may not be as nice as perl
for some flow control things but goto is never needed in c either. i
have seen it used and there are always better ways to code it than with
gotos. you just need to know other techniques and none of them are
convoluted. a better design helps too.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to