Hacker News new | past | comments | ask | show | jobs | submit login

Without goto, you'd either introduce a bunch of unnecessary functions or do this:

  init;
  do {
    stuff;
    if (fail) continue;
    morestuff;
  } while (0);
  cleanup;
Which I've seen in real code released to the public. Whoever does either of those things instead of just using a goto should be flogged in the town square.

edit: Other usually-bad alternatives to goto are the pyramid-of-nested-ifs or a set of running "bad" flags/enum that disables each operation downstream of the error until the cleanup is reached.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: