Show Navigation
Conversation
Notices
-
Perhaps aborting a program isn't an acceptable way of terminating it and should be considered a bug. Exit codes and properly defined behaviour sounds preferable.
-
@thatbrickster I guess it depends on what context the program runs in and what you want to achieve. If it's something that interacts with a user then a program that bombs out with a naked error code is a crock - the program should either retry or if there's user-generated state the program should try to fail gracefully (drop work done so far to disk then try to recover on restart). Then there's the Erlang approach if you have a real-time system and want high reliability. Many faults in such systems are often caused by transient events so the best thing to do is fail and get restarted. Might have saved the Ariane V.
-
@hattiecat I posted more about it further on.
-
@thatbrickster Beat me to it!
-
@thatbrickster Aside: There are some circumstances where you don't want to just abort on error for performance reasons. If you have a pipelined vector processor or similar, then for max. performance you want to keep on going, because of the large performance hit if you stop or branch elsewhere (pipeline stalls, context switch etc.). In any case, the error might not actually matter. So you just set an NaN or something and figure it out later. The old CDC mainframes used to do that. (Maybe not so relevant now but back in the day...)
-
@hattiecat You can see I've never worked with systems like that because I didn't think of that.