C style error codes suck because they're too easy to forget to check (by the
way, null is a lot like a C style error code because it extends the normal
domain of a result invisibly, so it sucks too).

But to be fair Joel also talked about the ML/Haskell(/Scala/F#/etc) style of
returning an algebraic data type that indicates a "good result" in a certain
domain vs a "bad result," so forgetting to check isn't such a problem and
the use of higher order functions and/or monad comprehensions takes the
sting out of checking.  So in those languages you have viable alternatives
to exceptions without the nastiest downsides of C style error codes.

If/when Java gets lambdas, that style of coding will become viable in it as
well.

That said, even in those languages you'll find exceptions used much more
than Joel might like.  Algebraic types like "Maybe/Option" and "Either,"
even though relatively pleasant to use, aren't invisible and often
"invisible" really is a better way to go.


On Thu, Aug 20, 2009 at 7:36 AM, Reinier Zwitserloot <[email protected]>wrote:

>
> Joel on Software's view that exceptions are bad and you should be
> using archaic C style error codes is, in a word: Effing Retarded.
>
> Follow his advice at your own peril.
>
> On Aug 20, 4:03 pm, Martin Wildam <[email protected]> wrote:
> > Anyone a fan of this:http://www.joelonsoftware.com/items/2003/10/13.html
> >
> > I am. :-)
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "The 
Java Posse" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/javaposse?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to