Which of the following blocks of code is the better style?
void doSomething(Object foo)
{
if(foo == null) return;
.
.
.
}
or
void doSomething(Object foo)
{
if(foo != null)
{
.
.
.
}
}
I know they have the same semantic meaning, but I've seen both styles used around the web and within production code. Are there any big reasons I should use one over the other?