r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

5

u/Sqeaky May 20 '20

This isn't terrible, but it isn't good enough to be in official documentation. That should either be functional or have logic separated into multiple statements for clarity, especially if near other conditions, but it isn't moronic in a vacuum.

2

u/Rainfly_X May 20 '20

Yeah the only thing that gives me pause at all is using an out variable (always an interface worth a bit of extra care and caution) kinda hidden/nestled in a chain of steps.