Lets say I have simple IsSomething()
method which checks, if object meets few requirements. Which approach is better?
public bool IsSomething()
{
if (!MeetRequirementX()) return false;
if (!MeetRequirementY()) return false;
if (!MeetRequirementZ()) return false;
return true;
}
Or
public bool IsSomething()
{
if (MeetRequirementX() &&
if MeetRequirementY() &&
if MeetRequirementZ())
return true;
return false;
}