Aug 11, 2007
Avoiding error handling results in shorter and clearer code. In C etc. you have to write something if you detect an error, but in Erlang it’s easy - don’t even bother to write code that checks for errors. Just let it crash, the Erlang runtime will provide a perfectly acceptable error diagnostic.

Then write a new linked process that observes the crashes and tries to correct the error. If it can’t correct the error it should crash (same principle). Each monitor should try a simpler error recovery strategy, until finally the error is fixed.

Joe Armstrong has a new take on the error codes vs exceptions debate.

Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.

archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)