NYCPHP Meetup

NYPHP.org

[nycphp-talk] Best practices for naming conventions & coding style?

Daniel Convissor danielc at analysisandsolutions.com
Tue Apr 28 08:54:36 EDT 2009


On Mon, Apr 27, 2009 at 10:18:42PM -0400, Edward Potter wrote:
> 
> employees
> --------------
> id
> firstname   <= generally for my field names I'll link words with _, just
> firstname and lastname I concatenate.
> lastname
> company_id
> 
> 
> companies
> -------------
> id
> company

But in that scheme, in order to join tables, you have to use an ON syntax
   JOIN companies ON (companies.id = employees.company_id)
rather than the more elegant USING syntax
   JOIN companies USING (company_id)

Plus it causes the use of different words for table vs field names, 
making it harder to guess/remember what a given identifier's name is and 
results in hacks when implementing automated schema tools.

--Dan

... snip ...

-- 
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
            data intensive web and database programming
                http://www.AnalysisAndSolutions.com/
 4015 7th Ave #4, Brooklyn NY 11232  v: 718-854-0335 f: 718-854-0409



More information about the talk mailing list