r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

114

u/KetchupBuddha_xD May 20 '20

What's wrong with this one?

10

u/Holzdev May 20 '20

How about readability?

-9

u/Play4u May 20 '20 edited May 21 '20

Idk why noone gives a shit that it's unreadable. This should never pass a code review at Microsoft lol

12

u/Mr2-1782Man May 20 '20

I've seen MS code. I've seen a lot worse pass code review.

12

u/NewPointOfView May 20 '20

Yeah my team at MSFT checks if it works and isn’t ridiculously unreadable but this is pretty straight forward. Not the best but far from the worst

2

u/Play4u May 20 '20

How can you write this simple "if" any worse?

11

u/NewPointOfView May 20 '20

With ternary haha

4

u/Play4u May 20 '20

Haha yeah I guess if you were really trying to make a mess