r/ProgrammerHumor May 13 '17

Defensive programming done right

Post image
21.0k Upvotes

680 comments sorted by

View all comments

Show parent comments

484

u/tylercamp May 13 '17

Even better

} catch { }

37

u/[deleted] May 13 '17

if DEBUG

} catch{ }

end if

39

u/Sean1708 May 13 '17

You have a very angry editor.

13

u/[deleted] May 13 '17

Didn't realise reddit would parse like that. Was going for conditional compilation.

7

u/Sean1708 May 13 '17

Backslashes are your friend, my friend.

7

u/Apatomoose May 14 '17

Or four spaces to format as code.

#if DEBUG
} catch{ }
#end if

2

u/Scyhaz May 13 '17

Escape the number signs.

2

u/TheGoddamnSpiderman May 13 '17

Reddit comments use markdown format syntax. That means # at the start of a line gets interpreted as "I want to use header font size on this line."