in reply to Re^2: "Subroutine basics" What does -1 mean ?
in thread "Subroutine basics" What does -1 mean ?

This node was taken out by the NodeReaper on May 30, 2014 at 11:18 UTC
  • Comment on Reaped: Re^3: "Subroutine basics" What does -1 mean ?

Replies are listed 'Best First'.
Re^4: "Subroutine basics" What does -1 mean ?
by mr_mischief (Monsignor) on May 29, 2014 at 20:58 UTC

    I'm guessing you're a little short in the humor department today. The chatterbox, by the way, is supposed to be ephemeral since we're harping on "convention" now.

    Since you're bringing this back to starkly serious now, sometimes the best place to exit from a program is in an error-handling subroutine rather than three or four calls up the stack. In any case, the question was not about moving the exit() to a more suitable part of the code. It was a question of what the return code means, which depends on the operating environment since it's a return to that environment's control.

    Now, is "Subroutine Basics" in SoPW the place to hint wildly at meaning about a tangential topic, or is the advice given about the difference between return and exit more appropriate?

    A reply falls below the community's threshold of quality. You may see it by logging in.