Naming conventions

Поиск
Список
Период
Сортировка
Искать

Naming conventions

От:
Mark Walker <furface@omnicode.com>
Дата:
Sorry if this may be a bit off topic.  I'm curious what naming 
conventions people use for column names.  After trying quit a few 
different conventions I've come to use differing cases and the 
underscore to identify and delimit variables.  A lot of it has to do 
with sql and Postgresql reserved words, for instance "password" would be 
"_password" for a column name.  "Invoice Number" would be 
"_invoiceNumber"  Hmm, is sql case sensitive?  I don't think so.  It's 
mainly for my own benefit as well as code generators I use. 

Also, if I have to identify different modules within the same database 
I'd use something like "accounting_invoiceNumber"

It's similar to a commonly used c++ convention for variable names.  I 
know it looks a little weird, but sql reserved words is a very real 
problem that needs to be dealt with, and having strange spellings like 
"dte" for "date" or an unnatural addition like "invoice_date" creates 
confusion when coding for me.  It's better to just have something like 
"_date" which is unambiguous if you're using table "invoice" and column 
"_date".

Just wondering what other approaches there are for this.  Variable, 
class, function naming, I think, is one of most important issues in 
programming.

Thanks.

FAQ