Erlang question on Artima blog

Vance Shipley <>
Sun Mar 14 19:48:33 CET 2004


The real trick is to decide when to accept errors and when
not to.  You expect file:open/2 to always work and if it
doesn't you crash.  That one's easy.  When you are parsing
user input, like in a shell, you probably want to handle
unexpected data without crashing.  What about external
data arriving in a protocol?  If it doesn't obey the 
protocol should you crash or should you treat it as the
user input case?  What about databases; if they don't 
contain the data you expect should you crash?  Designing
an error handling strategy can be complicated.

	-Vance

On Sun, Mar 14, 2004 at 09:31:16AM +0100, Ulf Wiger wrote:
}  
}  Personally, I think "programming for the correct case" has
}  significantly improved the readability of my own programs
}  (at least my own ability to understand what I've written.  ;)



More information about the erlang-questions mailing list