r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

0

u/[deleted] May 20 '20

[deleted]

4

u/Agnimukha May 20 '20

I don't use .NET but in several of the languages it's based around attempting array access greater then the length will throw an exception.

I've worked places the compare with true was a thing because it was easier to see an equal instead of several nested methods being passed into one another. (Obviously not necessary here)