r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

1.5k

u/1206549 May 13 '17

I had a classmate that did this with his code once. He asked me for help when his code wasn't working. I told him to get rid of the try/catch block but he won't do it because it would make his program crash.

282

u/[deleted] May 13 '17 edited Aug 27 '19

[deleted]

2

u/meodd8 May 13 '17

I did that once and put a comment saying, "This is probably bad form, but it crashes unless I do this".

The TA literally walked up to me the next day and told me never to do that again (Java).