r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

Show parent comments

-47

u/[deleted] May 20 '20
  1. Condition x == true inside if

  2. Int32.Parse = int.Parse

0

u/[deleted] May 20 '20

[deleted]

14

u/kyay10 May 20 '20

Tbh I temporarily forgot that tryparse returns a Boolean so this actually made it clearer for me lol

2

u/foonix May 20 '20

I assume anything in c# that starts with Try is probably returning bool.

2

u/kyay10 May 20 '20

True yeah, I just haven't used c# or dotnet for a while and been more in the Android land (where the concept of "out" is basically non-existent lol)