[erlang-questions] feedback please

Richard A. O'Keefe <>
Fri Sep 25 02:58:38 CEST 2015


On 24/09/2015, at 5:56 pm, zxq9 <> wrote:

> On Thursday 24 September 2015 07:41:40 Roelof Wobben wrote:
>> Thanks,
>> 
>> You are right. I did take a quick look and almost the whole chapter is 
>> try .. catch.  So match or chrash is better ?
> 
> It is not so much of a matter of which is "better" -- but that *most* of the time you want to follow the mantra of "let it crash" and this is a very natural fit for Erlang.

It must be said that *this* specific example is one where
crashing is an extremely bad thing.  If you went to your
ATM and a process in the bank's machines had crashed and
completely lost track of your money, you would be EXTREMELY
unhappy.  Lawyer-level unhappy.

A lot of values can be thrown away and no harm done.
But if a process is supposed to be managing persistent
state there may be serious legal penalties attached to
losing it.

This would make a nice little DETS example:  does it
really make sense to keep the balance in a persistent
store?  Too right it does!



More information about the erlang-questions mailing list