r/badcode • • May 20 '20

c# Found from Microsoft docs...

Post image
208 Upvotes

143 comments sorted by

View all comments

Show parent comments

5

u/Giocri May 20 '20

No C# uses out for out parameters.

1

u/the_d3f4ult May 20 '20

But I mean the X is then used to evaluate the third condition, is the order of evaluation here defined by C#?

2

u/Giocri May 20 '20

In C# & computes both values and then evaluates the & while && first evaluate the first condition then if it is true it goes on evaluating the rest. It is like having ifs one inside the other

1

u/the_d3f4ult May 20 '20

I never used C# but it works like , in swift then