Re: Shortening constant names

From: Date: Tue, 27 Jun 2006 19:24:08 +0000
Subject: Re: Shortening constant names
References: 1 2  Groups: php.pear.dev 
Request: Send a blank email to pear-dev+get-43156@lists.php.net to get a copy of this message
Hi, Justin Patrin wrote:
On 6/26/06, Olivier Guilyardi <ojaiml@nerim.net> wrote:
Hi, In Structures_DataGrid, could we use SDG instead of DATAGRID as constant prefix?
I think you should just get rid of them, as I've mentioned previously. Why have constants set up for the data sources and renderers when you could just type the class name instead?
IMO, for people with general programming background, the constants makes it easier to understand the code. Literals like "XML", "MDB2", because they are not _defined_ as constants, will make the code lose some of its clarity. But this still needs thinking. Typing the whole class name is too long/ugly to me.
It also makes no sense to have constants defined for packages you have to install seperately.
These other packages are : SDG official drivers. So it makes sense for SDG to know about them, even if they are not all installed. SDG even has specific container detection routines that relates to these drivers, used by fill() and bind(). It is not just external packages, it's "subpackages". Regards, -- og

« previous php.pear.dev (#43156) next »