2 ms·
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
by mort96 9y ago
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.