Which one out of following two is best wrt to performance and standard practice. How does .NET internally handles these two code snippets?
Code1
If(r
Both styles are commonplace, and religious wars have been fought over them. :-)
I normally do this:
However, arguably a more important rule is "which is more readable and/or maintainable for the next developer who looks at the code?".
The performance difference is negligible, as others have said.