Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
Bah fine poor example, change return values / functionality. Basically, if the if returns do you still specify the else?
-
@vimordeath in my company we have a lint rule to not write else when there is a return in the if.
-
@shellbug that is just what I was looking for, didn't word it correctly so I don't think many people got it but that was exactly what I was wondering. Thanks!
-
@vimordeath I don't completely agree with it, tho. In the end it's just a matter of style, doesn't really matter how you choose to do it.
What do people like more?
if(condition){
return true;
} else{
return false;
}
Or just
if(condition){
return true;
}
return false;
question