To throw or not to throw [was: Go Programming talk [OT]]
Leandro Lucarella
llucax at gmail.com
Wed Jun 9 09:22:23 PDT 2010
Leandro Lucarella, el 9 de junio a las 11:37 me escribiste:
> Pelle, el 9 de junio a las 13:28 me escribiste:
> > >Yes, I agree that "safety" is the best argument in favour of exceptions
> > >(as explicitness is the best argument in favour of no-exceptions). The
> > >Python Zen put it this way:
> > >
> > >Errors should never pass silently.
> > >Unless explicitly silenced.
> > >
> > >That's what I like the most about exceptions. I think try/catch is
> > >really ugly though. There has to be something better.
> >
> > Careful use of scope(exit) and simply avoiding catching exceptions
> > works well for me. Except when you have to catch, of course. :)
>
> I'm talking precisely about the case when you have to catch. In that
> case I think the resulting code is uglier and more convoluted than the
> code to manage errors by returning error codes or similar.
BTW, here is a PhD thesis with a case against exceptions. I didn't read
it (just have a peek) and it's rather old (1982), so it might be not
that interesting, but I thought posting it here as the thread became
mostly about exceptions and someone might be interested =)
http://web.cecs.pdx.edu/~black/publications/Black%20D.%20Phil%20Thesis.pdf
--
Leandro Lucarella (AKA luca) http://llucax.com.ar/
----------------------------------------------------------------------
GPG Key: 5F5A8D05 (F8CD F9A7 BF00 5431 4145 104C 949E BFB6 5F5A 8D05)
----------------------------------------------------------------------
Every 5 minutes an area of rainforest the size of a foot ball field
Is eliminated
More information about the Digitalmars-d
mailing list