Hacker News new | ask | show | jobs
by djoldman 1868 days ago
Quick question: all the goto fail's where

  fail:
    return false;

This is just to perhaps change return false to something else in the future, correct? Else why not just return false everywhere instead of goto fail
3 comments

Not sure if this is the author's reason but I find it helpful to have a single return point from functions. Much easier to follow code paths.

You'll see this in some places in Linux's source too.

I think it’s to cleanly show when he is using his pseudo-exception handling system. So goto fail would be “throw”
Not op, but that's obviously in case you need to do something more complicated than returning false later. It's good practice