Re: consistent PHP function names?

From: Date: Wed, 17 Sep 2003 11:22:36 +0000
Subject: Re: consistent PHP function names?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-162853@lists.php.net to get a copy of this message
I posted a similar topic a few months back. I guess the answer is that the collaborative nature of open source, and the fact that PHP has grown from very humble beginnings has meant that naming standards and conventions are a little lacking. It would've been nice if these issues were rectified in PHP5 with deprecated aliases to the old names left in for backwards compatibility, but it'd be a HUGE job :) Justin On Wednesday, September 17, 2003, at 08:51 PM, Eugene Lee wrote:
One thing that's always bothered me about PHP is that the function names are not terribly consistent. For example, when are underscores okay? strip_tags() has an underscore but stripslashes() does not. Also, should inverse functions be named appropriately? htmlentities() and html_entity_decode() are inverse functions. But seems to make more sense to rename htmlentities() to html_entity_encode(). Something like a class[_subclass1[_subclass2[...]]]_method nomenclature makes sense. Then you have really weird stuff. For example, md5() is listed as a "string function" since it takes a string, calculates the MD5 hash, and returns said hash. Makes sense. Then you have md5_file(), which takes a filename, calculates the MD5 hash of the file's contents, and returns said hash. But md5_file() is listed as a "string function". To me, it makes more sense to be classified as a "filesystem function", and maybe even rename the function to file_md5(). Thoughts? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php --- [This E-mail scanned for viruses]


« previous php.general (#162853) next »