Small poll

Bengt Kleberg Bengt.Kleberg@REDACTED
Fri Dec 19 10:53:38 CET 2003


Chris Pressey wrote:
...deleted
> In Erlang as we know it, a + 42 generates an exception.  An exception is
> by definition not a show-stopper; it can be caught and acted upon.  But
> by changing it into a compile-time error, you're not even giving the
> program an *opportunity* to crash.  This runs against the "let it crash"
> philosophy in my book.

as i see it (ie, really subjective thinking will follow here):
i think ''let it crash'' is a good idea. i think it is such a good idea 
that i want it to happen as soon as possible. in this case*, as soon as 
possible is during compilation.

*quick reminder:
all exported functions in the module will crash, there are no 
alternative ways for them to maybe succeed.


> Also, by forcing the programmer to write throw(blah) to cause an
> exception, you're making them *make* it crash, which also runs counter
> to "let it crash" - the programmer needn't exert such explicit effort.

i am advocating erlang:throw() as a better solution than ''a+42'' to 
force a crash. i am not advocating erlang:throw() as a replacement for 
mistyping ''A+42'' :-)


bengt




More information about the erlang-questions mailing list