It depends, I prefer the same as FredOverflow
return someCondition ? doSomething() : doSomethingElse();
If this is enough. If it isn't, I have wondered for a similar situation - if you have longer code - lets say 30-40 lines or more, should I put return; on a place, that's not necessary. For example, consider the following situation:
if( cond1 )
{
if( cond2 )
{
// do stuff
}
else if( cond3 )
{
// ..
}
}
else if( cond4 )
{
// ..
}
else
{
//..
}
What I wondered was - should I put return; (in void function) at the end of each case - is this a good or bad coding style (as it doesn't matter if there's return; or not). Finally I decided to put it, because the developer, who'll read this code later, to know that this is a final state and there's nothing to be done anymore in this function. Not to read the rest of the code, if he/she's interesting only in this case.