Bool myFunction{
If (IamCool == True)
{
Return true;
}
/*Do some other stuff here*/
return false;
}
Bool myFunction{
If (IamCool == True)
{
Return true;
}
else
{
/*Do some other stuff here*/
return false;
}
}
Should one of these be used in preference to the other? I mean they do the same thing, so I can't see why not, but I've just done the former example in one of my projects, and it's made me curious.
Question
+Majesticmerc MVC
Take the following code for example...
Should one of these be used in preference to the other? I mean they do the same thing, so I can't see why not, but I've just done the former example in one of my projects, and it's made me curious.
Any comments appreciated,
-- El Sid
Link to comment
Share on other sites
11 answers to this question
Recommended Posts