2 ms·
As yohanatan mentions, the OTP ecosystem is build around the notion of letting processes crash. In every other language that I can think of, you try to handle a
by adrusi 12y ago
As yohanatan mentions, the OTP ecosystem is build around the notion of letting processes crash. In every other language that I can think of, you try to handle all errors immediately when they happen, whether that be an explicit check like in C or Go, or through some kind of exception system.
In Erlang/Elixir, your programs should be designed such that each process performs a small enough task that if it crashes unexpectedly, you can "recover" by restarting it. This idea is complemented by the shunning of side effects.
If you do it right, you end up writing wildly different programs in erlang/elixir than you would in other languages.
That said, erlang is specialized for a certain kind of problem, and if you're not building large-scale distributed systems, you probably won't as much out of erlang. Clojure is more general purpose.