Hacker News new | ask | show | jobs
by masklinn 4467 days ago
> Descriptive function names never lie

Beg pardon[0]?

    function _utf8Encode(&$arr){ 
      for($i=0;$i<(count($arr['parameters']));$i++){ 
        $arr['parameters'][$i]= $arr['parameters'][$i]; 
      } 
    } 
    function _utf8Decode(&$arr){ 
      for($i=0;$i<count($arr['parameters']);$i++){ 
        $arr['parameters'][$i]= $arr['parameters'][$i]; 
      } 
    }
Or[1]

    public static string ReturnEmptyStringIfNullElseValue(string value) {
        if (value == null) {
            return "";
        } else {
            return value.ToString().Trim();
        }
    }
[0] http://thedailywtf.com/Comments/There-and-Back-Again.aspx

[1] http://thedailywtf.com/Articles/Common-Functions,-not-Common...

1 comments

I stand corrected. Thank god I never have to deal with such code!