try without catch or finally

Andreas Rossberg rossberg at google.com
Wed Apr 18 01:49:14 PDT 2012


On 17 April 2012 22:35, Jussi Kalliokoski <jussi.kalliokoski at gmail.com> wrote:
> I'm not sure if this has been discussed before, but is it a terribly bad
> idea to make catch/finally optional for a try block?
>
> There's a lot of code like this out there:
>
> try { /* something here */ } catch (e) { /* nothing here */ }

Silent catch-alls like that are almost always bad code. I think the
language rather shouldn't encourage this pattern with extra
convenience.

/Andreas


More information about the es-discuss mailing list