Re: [PHP6] Function name consistency

From: Date: Wed, 22 Jan 2014 22:17:25 +0000
Subject: Re: [PHP6] Function name consistency
References: 1  Groups: php.internals 
Request: Send a blank email to internals+get-71416@lists.php.net to get a copy of this message
On Sat, Dec 28, 2013 at 3:57 PM, Yasuo Ohgaki <yohgaki@ohgaki.net> wrote: > I know this has been discussed before, but I'll try again. > We have following coding standard > > 1. Function names for user-level functions should be enclosed with in > the PHP_FUNCTION() macro. They should be in lowercase, with words > underscore delimited, with care taken to minimize the letter count. > Abbreviations should not be used when they greatly decrease the > readability of the function name itself:: > > Good: > 'mcrypt_enc_self_test' > 'mysql_list_fields' > > Ok: > 'mcrypt_module_get_algo_supported_key_sizes' > (could be 'mcrypt_mod_get_algo_sup_key_sizes'?) > 'get_html_translation_table' > (could be 'html_get_trans_table'?) > > Bad: > 'hw_GetObjectByQueryCollObj' > 'pg_setclientencoding' > 'jf_n_s_i' > > https://github.com/php/php-src/blob/master/CODING_STANDARDS > > > There are many functions that violate this for historical reason. > Since PHP has function alias feature by default, function names that > violate this standard could be renamed and keep historic names as aliases. > > We may keep alias 10 or 20 years or even forever. > > Good IDE can suggest correct names, but keeping inconsistent historic > function names forever damages PHP future in the long run, IMHO. > > Any comments? > Added RFC for this. https://wiki.php.net/rfc/consistent-names Regards, -- Yasuo Ohgaki yohgaki@ohgaki.net

« previous php.internals (#71416) next »