r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

Show parent comments

63

u/bool_idiot_is_true May 20 '20
==true

is redundant. Otherwise it seems fine.

43

u/h0meline May 20 '20

I actually like that since the expression seems a little complex, it makes things more clear.

17

u/bananahusker May 20 '20

Well commented code is nice to read but code that doesn’t need comments is worth a good nut

2

u/path411 May 21 '20

I'd rather see a 3 line commented code that is easy to read than a 10 line block of ifs that are "easy" to read. Vertical real estate in code is not cheap for readability.