Friday, June 13, 2014

Only two things are infinite...

 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:


    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...