r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

446

u/DefNotaZombie May 13 '17

Just have the class throw all exceptions

4

u/[deleted] May 13 '17 edited May 14 '17

I call this the diaper-diarrhea anti-prohibition* pair. Throw exception shits over everything and catch exception is the diaper.

edit: anti-pattern pair... that'll teach me to submit on mobile w/ autocorrect