Неудобный IF

    Date: 10/25/07 (Code WTF)    Keywords: no keywords

        public static function getPublicCommonCriteria($criteria=null) {
            if ( $criteria != null ) {
            } else {
                $criteria = new Criteria();
            }
    
    Если в IF неудобный предикат, то пихаем логику в ELSE. Грамотно.

    Source: http://community.livejournal.com/code_wtf/109190.html

« похапе || Creole is inspired by... »


antivirus | apache | asp | blogging | browser | bugtracking | cms | crm | css | database | ebay | ecommerce | google | hosting | html | java | jsp | linux | microsoft | mysql | offshore | offshoring | oscommerce | php | postgresql | programming | rss | security | seo | shopping | software | spam | spyware | sql | technology | templates | tracker | virus | web | xml | yahoo | home