r/badcode • • Feb 02 '22

c# Oh hey, its more of my code.

Post image
902 Upvotes

95 comments sorted by

View all comments

Show parent comment

1

u/Knuffya Feb 03 '22

Then it should throw an exception. Then true and false are both wrong results.

2

u/[deleted] Feb 03 '22

It's really annoying to see code like this (obviously not within the context of r/badcode when the author realises it's bad, but like actual production code). The System namespace has like a million general-purpose exception classes that can be applied to almost every scenario. Why aren't people using them?!?!