On Sat, Dec 28, 2013 at 3:57 PM, Yasuo Ohgaki <[email protected]> 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
[email protected]