Re: PEAR Coding Standards
| From: | Pierre-Alain Joye | Date: | Fri, 13 Dec 2002 21:49:25 +0000 |
| Subject: | Re: PEAR Coding Standards | ||
| References: | 1 2 3 4 5 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-11632@lists.php.net to get a copy of this message | ||
On Fri, 13 Dec 2002 22:35:45 +0100
Mirco "MEEBEY" Bauer <pear-dev@meebey.net> wrote:
>
> The request was givin with the reason of a new PEAR package called
> Net_SmartIRC... About the constants, the developer that use my class
> then has for instance todo this:
>
> register_actionhandler(NET_SMARTIRC_TYPE_QUERY|NET_SMARTIRC_TYPE_NOTI
> CE, '^test', $bot, 'query_test');
>
> instead of:
> register_actionhandler(TYPE_QUERY|TYPE_NOTICE, '^test', $bot,
> 'query_test');
>
> see the differenz?
I see it. And that sounds quit logical to me. For instance check
XML_XSLT_Wrapper if you want see longer constants names. This is
definitivly not a problem. Good&readable code is usually not equal to
short name.
And you catch a point with TYPE_QUERY, this name may exist is too many
packages as you can imagine :)
Namespaced constants, how can you manage it ? even with a real namespace
?
To avoid a troll, this is the *standart*, just apply it even you do not
like it :-)
hth
pierre