Understanding Erlang's 'let it crash' philosophy

253
clicks
Understanding Erlang's 'let it crash' philosophy
Adolfo Neto authored an article exploring the 'let it crash' error handling strategy in Erlang, which is rooted in the ideas of Joe Armstrong, one of Erlang's creators. The post begins with the motivation behind adopting such an error-handling strategy, evidenced by a motivating tweet. It emphasizes the importance of checking inputs at 'untrusted' interfaces and when a detailed error diagnostic is needed. Sharing a snippet of code written by Joe Armstrong, the article explains how Erlang encourages letting the system crash when encountering unexpected situations as opposed to implementing extensive error handling code. This philosophy is based on the expectation that an independent process or 'monitor' will observe crashes and attempt to correct errors or report an inability to do so. Such an approach is likened to an idealized human organization with clear-cut responsibilities, promoting simpler, clearer code and recovery strategies, as well as separation of concerns between doing the job and handling errors when they occur.

© HashMerge 2024