[erlang-questions] Package Support/Use
Robert Virding
robert.virding@REDACTED
Tue Nov 7 00:07:18 CET 2006
Sorry, I find this discussion completely ridiculous!
Having everything as an exception is just as stupid and difficult to
manage as having nothing as an exception! Irrespective if you define the
exceptions as part of the documentation of a function, it is not a
documentation problem as such.
Save exceptions for things which are truly exceptional or program errors
or where things have gone wrong.
If the arguments to file:open have the wrong format or are wrong then it
is a program error and should be signalled with an exception, if the
file does not exist then it is application dependant whether it is an
exception or an accepted return. If I signal both as an exception then I
will always have to be able to handle the exception case which will
realy complicate the programmers job.
"Let's see which exceptions signaled a file which wasn't there? Ah,
these 5 exceptions handle that case. I know I will write a new library
function which handles these cases for me which will make my life easier."
Perhaps we should have used {yes,Value}|{no,Reason} instead of the more
loaded ok/error?
I have been known to have rather dogmatic views sometimes (often) but
soem commonsense is needed.
Robert
More information about the erlang-questions
mailing list