Re: RFC: Renaming PostgreSQL functions

From: Date: Tue, 11 Dec 2001 22:36:55 +0000
Subject: Re: RFC: Renaming PostgreSQL functions
References: 1 2 3  Groups: php.dev 
Request: Send a blank email to php-dev+get-73177@lists.php.net to get a copy of this message
Egon Schmid wrote:
From: "Jon Parise" <jon@php.net>
On Tue, Dec 11, 2001 at 09:06:52PM +0900, Yasuo Ohgaki wrote:
I would like to rename PostgreSQL functions to comfirm naming/coding standard. Similar change has been done for MySQL module, AFIAK. I'll take care documentation changes also. Almost all changes are just a matter of adding "_" to current names, except pg_cmdtuples. The new name is pg_affected_rows, like MySQL.
I sort of prefer the names the way they are. I'd almost prefer to remove the underscores from the MySQL extension (which I'm not suggesting). The two extensions are disimilar in enough ways to make any attempt to unify the interface moot. For example, look at pg_exec() and mysql_query(). These two functions affectively do the same thing and yet they are named differently and accept their arguments in the opposite order.
If you start this name change I hunts you like Osama bin Laden. Make the new function names with underscores between any words and move the old working functions in a alias section. -Egon
But it is in TODO list. I don't think renaming function makes me a Laden :) If it's not a really a TODO, I won't waste my time. From TODO-4.2 * Renaming functions, so that they all are conform to one standard form. From 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'
I thought that's why function names are changed. Any comments? -- Yasuo Ohgaki

« previous php.dev (#73177) next »