tj.crowder at farsightsoftware.com (2017-08-12T08:15:12.725Z)
On Sat, Aug 12, 2017 at 7:14 AM, Hikaru Nakashima <oao.hikaru.oao at gmail.com> wrote:
> In addition, there is `optional catch binding` proposal, and this
> idea is less dangerous.
> Rather, this idea looks natural, because `foo = try bar` is looks
> like `foo = do { try { bar } }` .
I think you're misunderstanding the [optional catch binding proposal][1].
It does **not** make `try { something }` valid. It makes `try { something }
catch { }` valid. It's for all those times you don't need the exception, so
the *binding* (the `(e)` part of `catch (e)`) is made optional.
If I'm wrong about your misunderstanding the proposal, my apologies; if so,
what's dangerous about optional catch bindings?
Making `catch` optional would indeed, in my view, be dangerous, which is
why I don't like the suggestion that's the topic of this thread. If you're
going to ignore exceptions on a block, for which, yes, there are valid use
cases, I much prefer that it be explicit.
-- T.J. Crowder
[1]: https://tc39.github.io/proposal-optional-catch-binding/
On Sat, Aug 12, 2017 at 7:14 AM, Hikaru Nakashima <oao.hikaru.oao at gmail.com> wrote: > In addition, there is `optional catch binding` proposal, and this > idea is less dangerous. > Rather, this idea looks natural, because `foo = try bar` is looks > like `foo = do { try { bar } }` . I think you're misunderstanding the [optional catch binding proposal][1]. It does **not** make `try { something }` valid. It makes `try { something } catch { }` valid. It's for all those times you don't need the exception, so the *binding* (the `(e)` part of `catch (e)`) is made optional. If I'm wrong about your misunderstanding the proposal, my apologies; if so, what's dangerous about optional catch bindings? Making `catch` optional would indeed, in my view, be dangerous, which is why I don't like the suggestion that's the topic of this thread. If you're going to ignore exceptions on a block, for which, yes, there are valid use cases, I much prefer that it be explicit. -- T.J. Crowder [1]: https://tc39.github.io/proposal-optional-catch-binding/ -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20170812/72c45020/attachment.html>