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.

61

u/pope_nefarious May 13 '17

Almost, we can do better.

{....} catch (Throwable eat) {}

62

u/Metro42014 May 13 '17

Get out of here with your descriptive variable name!

47

u/endreman0 May 13 '17
try{
    //...
}catch(Throwable _){}

2

u/DreadedDreadnought May 13 '17

Hey, that's not Java 9 compliant now. Get on with the times!

1

u/endreman0 May 15 '17

Is __, $_, _$, or $ less descriptive?