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
Personally I always like to return ASAP so I would go for something like:
if (result)
{
// do something
return;
}
// do something if not result
With regards to performance, I doubt either have any advantages over eachother it really comes down to readability and personal taste. I assume .NET would optimize your first code block to something like the above.