Re: Column naming convention good or bad?

From: John Doherty <jdoherty_at_ix.netcom.com>
Date: Mon, 20 Nov 2000 23:59:45 -0600
Message-ID: <jdoherty-2011002359460001_at_aus-tx44-40.ix.netcom.com>


In article <8ut094$fqo$1_at_news.utelfla.com>, "Ali Tajdari" <tajdaria_at_nettally.com> wrote:

| My company is developing an SQL coding conventions document. We are
| currently considering using a three letter prefix for column names. The
| prefix would indicate the columns data type. Has anyone applied this type
| of standard before and was it useful? Is this naming convention bad?
|
| Examples: str_last_name or int_salary

This is the same sort of idea embodied by the so-called "Hungarian naming" used for variables at Microsoft.

Under that scheme, variables are named with a prefix that indicates the data type of the variable. So for example, a pointer to a string might be named "ptrString", an integer representing something might be named "intSomething," etc.

This is not really a very good idea: it emphasizes the underlying data type, and in the long run, that's not really what you want to focus on.

Give your variables (or columns) good, meaningful names that do not emphasize the underlying data type. In the long run, that practice is likely to serve you well.

Your data types may well change in the future, and it would be nice if that didn't require you to change all your variable (or column) names, too.

--
Received on Tue Nov 21 2000 - 06:59:45 CET

Original text of this message