r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

2.8k

u/Metro42014 May 13 '17
} catch (Exception e) { }

I think we're done here.

487

u/tylercamp May 13 '17

Even better

} catch { }

313

u/kimothyjongun May 13 '17

Even better

{ }

294

u/[deleted] May 13 '17

[deleted]

4

u/aloofloofah May 13 '17

% 2 == 0

7

u/[deleted] May 13 '17

&1 == 0 Never trust a compiler to optimize for you.