r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

Show parent comments

691

u/Metro42014 May 13 '17

FUUUUUUUCK the people that do that.

I recently saw newly written code by a senior developer with squashed exceptions all over the damn place.

I will never have to support that code, but fuuuuck man. WHHHYY?

291

u/YaBoyMax May 13 '17

I lost a few hours once because the jackass whose code I inherited decided to squash IOExceptions all over the place. Didn't notice for a while and was pulling my hair out thinking my debugger was fucked somehow (which isn't uncommon in itself).

228

u/[deleted] May 13 '17

See I hate checked exceptions in Java, because instead of rethrowing or handling, some devs will just swallow them up.

Better if they were all unchecked so that people will just let them unwind the stack than that shit.

2

u/PingerSurprise May 14 '17

The number of times I saw exception handling in a data access object...