Thursday, August 17, 2006

When programmers have coding & naming standards, database administrators should have them too. Well, that's what I'm trying to come up with.

For Naming

Naming items with initial caps and then capitalizing individual words within the name and eliminating spaces is a pretty good way to name database objects. Underscores and hyphens should be avoided because developers would find that harder to type than regular alphabets. With MS SQL Server, this naming convention is pretty good but for Oracle, it would be a bit of a hassle since SQL * Plus isn't case sensitive (anything you type is treated as upper case) unless you use quotes (single for CHAR, VARCHAR, TEXT, ...; double for database object names).

Abbreviations such as ID (for Identity or Identifier) should again follow the rule above - Initial caps followed by lower case, like so: "Id"

Underscores can be used if they really do enhance readability (such as for single-letter abbreviations), but only for non-key columns, since they don't have to be typed by developers very frequently.

For Coding

Just as with developers, commenting and indenting play an important role. You wouldn't want to be the guy reading through hundreds of uncommented and unindented lines, so why should you put anyone else in that position?

Final Thoughts

Standard and Policies are often suggestions (unless they state that they are regulatory) and you should use your discretion or tailor your own set of standards and policies. Either way, they should be consistent with those of the people working with you rather than treating it as a matter of 'style',

Comments: Post a Comment

<< Home

This page is powered by Blogger. Isn't yours?