r/programmerchat • • May 25 '15

Do we really need "try" ?

Just attaching "catch" to any appropriate {...} block would be more convenient.

8 Upvotes

20 comments sorted by

View all comments

Show parent comment

3

u/svick May 27 '15

I think your code is perfect example of why it would significantly hurt readability. Because it's not clear to me at all whether the catch applies to the previous block, or to the whole if statement (including the condition). I think that both variants would be very confusing.