Slashdot Mirror


Empirical Study On How C Devs Use Goto In Practice Says "Not Harmful"

Edsger Dijkstra famously opined in 1968 on the danger of Goto statements. New submitter Mei Nagappan writes with a mellower view, nearly 50 years later: By qualitatively and quantitatively analyzing a statistically valid random sample from almost 2 million C files and 11K+ projects, we find that developers limit themselves to using goto appropriately in most cases, and not in an unrestricted manner like Dijkstra feared, thus suggesting that goto does not appear to be harmful in practice. (Here's the preprint linked from above abstract.)

5 of 677 comments (clear)

  1. I prefer the Comefrom statement by Anonymous Coward · · Score: 5, Funny

    It gives me so much more flexibility and power. The computed comfrom is even better.

  2. XKCD by rhazz · · Score: 4, Funny

    Obligatory: http://xkcd.com/292/

  3. Limited sample :) by davidwr · · Score: 4, Funny

    I bet the "valid random sample" didn't include any projects from the Obfuscated C Code Contest.

    --
    Knowledge is how to play a game, intelligence is how to win, wisdom is knowing what game to play.
  4. Re:GOTO is a crutch for bad programmers by DamonHD · · Score: 1, Funny

    Some sort of nested do { ... } while(false); and break; would be my first suggestion.

    Rgds

    Damon

    --
    http://m.earth.org.uk/
  5. longjmp() by stox · · Score: 5, Funny

    is far more entertaining than a mere goto.

    --
    "To those who are overly cautious, everything is impossible. "