Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Naming Convention for Columns

Re: Naming Convention for Columns

From: Alvin Sylvain <alvin_at_NO.JUNK>
Date: 1998/03/09
Message-ID: <01bd4b0c$95038ad0$7387d9cf@rana>#1/1

Matthew O. Persico <mpersico_at_erols.com> wrote in article <3502286F.F7A463BA_at_erols.com>...
> > > Be consistent. NEVER mix upper and lower case in column names.
 You
> > > won't believe how much hair you'll rip out the 5th time you've
 retyped
> > > a simple query b/c you have mixed case in Sybase.
> >
> > This is very good advice, particularly considering that you never
> > know when you'll have to port to a database that doesn't support
> > mixed case anyway, and it'll just be dumb luck that thru the
 process
> > of mangling by multiple maintainers, to get something like both
> > "lcFlag" and "lcflag" in the same table. (Hey, in 200+ columns
> > and the 8th person to "fix" something, it could happen!)
>
> Ah, but what happens when your all lowercase, underbar separated
 column
> names get sucked into a C++ class? Most of the code I see in C++
 these
> days is capital letter separated, not all lowercase and underbar
> separated.

True enough, but C++ doesn't *FORCE* you to follow that convention. A case-insenstive system *forces* you to follow certain constraints.

> Especially if you know you won't be porting to something so
> primative in this day and age that it doesn't support letter case.

You can never be that clarvoyant. Or, I should say, you can't be that clarvoyant YET. Just like it no longer makes sense to code for an IBM PC with only 640 kilobytes of RAM in it ... but, at one time, it was foolish to assume that more than a few percentage of your potential customer base had upgraded to a full meg or more.

I'm thinking specifically of Oracle, which still defaults to case insensitivity. It's only the Numero Uno database on the planet. I believe it *can* be case sensitive, but I haven't found out how to set that up. Since everything we have currently is all lower case, I'm not motivated to investigate.

> As
> for which to actually choose, you tell me which has the best
 combination
> of space savings (and keystoke typing savings) and readability at 2am
> fixing a hong kong production problem from NYC:
>
> setldateovrd
> setl_date_ovrd
> setlDateOvrd
>
> You can make a case for the second or third but not the first.

It's a matter of taste. Keystrokes should rarely be a consideration: the two seconds you save could cost somebody an hour trying to figure out what you're trying to say. From that point of view, your second two examples are virtually identical. The first suffers problems such as "mans_laughter" vs. "manslaughter".

> Why am I sticking my $0.02 into this potential religious war?

Because it's more enjoyable than doing real work, of course! :-)

A. Received on Mon Mar 09 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US