News for hackers. Stuff that matters.
Re:Loop Exits and Structured Programming: Reopening the Deba... by mort96 on Monday June 12, 2017 @10:13PM (#14542476)
I don't like the goto fail thing being discussed as an example of goto being evil. If they had used the other common pattern - returning -1 on failure - instead of the pattern they used, their code would look like this:

  if (a)
      return -1;
  if (b)
      return -1;
      return -1;
  if (c)
      return -1;
  return 0;
And literally the exact same issue would occur, even though goto wasn't used.

There are no comments on this comment yet.