Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??
Thank you for the link to Knuth's paper.

I have read about it before, but not read it. As normally happens, there are insights in the original that are forgotten later. One of the best ones so far for me is the note on p277 which points to a proof by Rao Kosaraju that implies that the normal structured programming constructs, with loop control, with named loops is sufficient to replace any algorithm using gotos with an equivalent one without goto which does no extra computation. (The key point being no extra computation.) I find this an interesting theoretical validation of the point that loop control and named loops in Perl is sufficient to replace the vast majority of reasonable gotos in other languages.

And if you go on to p282 you will find the following quote:

Certain go to statements which arise in connection with well-understood transformations are acceptable, provided that the program documentation explains what the transformation was.
The example that he demonstrated this with was taking an obvious recursive algorithm, recognizing tail-recursion, and rewriting it for efficiency. This involved introducing gotos. In my note to Ovid above I used the examples of implementing a finite state machine, and TheDamian's Switch.

And then there are the comments which are fascinating in hindsight. For instance the one on p295 about how a given level of abstraction often defines several related routines and data definitions. His example is how the representation of a table is tied to the routines you need for storing to and fetching from it. His assertion that the next generation of languages will probably take into account such related routines seems to me to be an excellent anticipation of OO programming...

And his closing note about the future seems to be an excellent description of the present. Higher level languages like Perl often contain goto, but people just don't see the need to use it, and so the issue faces away. However, as he said, it remains true that if you let beginners know about goto and leave them with the opinion that it is OK to use the feature, they will discover many cases where they "need" goto, but the cause of the need is poor planning on their part, and they would be better off hitting the roadblock, backing off, and then rethinking rather than working their way forward into more trouble by adding gotos...


In reply to Re (tilly) 2: Would you use 'goto' here? by tilly
in thread Would you use 'goto' here? by Ovid

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (7)
    As of 2014-12-25 07:29 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      Is guessing a good strategy for surviving in the IT business?





      Results (159 votes), past polls