Was traversing through some very complicated code today. Insane mess of programming patterns multiplied by object-oriented ego. Its like a fucking zebra. Some parts are brutally complicated and others are just silly. Like this:
Seriously, if I had a dollar every time I see "if (X) return true; else return false;" idiom...
protected function callbackExists($names = array())
{
$exists = array();
foreach($names as $name)
{
$return = (bool)$this->getCallBack($name);
if($return)
{
$exists[] = $return;
}
}
if($exists)
{
return true;
}
return false;
}
Seriously, if I had a dollar every time I see "if (X) return true; else return false;" idiom...
No comments:
Post a Comment