NYCPHP Meetup

NYPHP.org

[nycphp-talk] naming identifiers

Mark Armendariz lists at enobrev.com
Tue Sep 1 09:11:48 EDT 2009


On Mon, Aug 31, 2009 at 8:22 AM, Kristina D. H.
Anderson<ka at kacomputerconsulting.com> wrote:
> I'm wondering why both phpMyAdmin and a number of the boilerplate PHP5
> frameworks' database code bases that I've seen all seem to be pushing
> the use of these delimiters around really, every single table and field
> name at all times, whether required or not.  I hadn't given it much
> thought until this thread but the amount of them that I've seen over
> the past year or so has skyrocketed.

I think the idea is less a matter of promotion and more to let the
programmer use whatever table / column names they prefer regardless of
best practices.  If they do it for everything they don't have to
maintain a list of reserved words, which may very well change between
versions.

I personally prefer prefixing column names with table names
(person_first_name, location_city, etc) for clarity in complex joins,
but if I really had some reason to name a varchar (can't think of
why), I'd prefer that my tools would allow me to do so.

As for joins, I agree with Dan Cech regarding explicitly naming join
types, join fields, and join conditions in the join...on rather than
the conditions.

Mark



More information about the talk mailing list