Thursday, February 28, 2008

OT: Why I refuse to prefix table names with "tbl"

I have been a bit busy lately and have not had much time to blog. But I came across a post today that reminded me of one of my firm rules. The post topic was naming conventions, and one of the conventions discussed was prefixing table names with "tbl". Now generally I prefer not to prefix variable and object names that way. I find it redundant, but I am not militant about the subject.

But I do remember seeing a post some time ago in which the asker used both a prefix and suffix. So their full table name was tblCustomerTable. Now, all stylistic preferences aside, I absolutely refuse to do that. Why? Because it might require me to have a conversation, in front of actual people, where I found myself uttering the words ".. and then do a select on the table customer table table". Say that three times fast. Can you imagine if the entire schema were like that? A minute or two of hearing ridiculous phrases like that and the entire room would start snickering. A minute after that I doubt even I could keep a straight face.

If I am ever unfortunate enough to work with such a schema, I can only hope all conversations take place via conference call .. and that everyone's mute button is working ;)

9 comments:

Anonymous,  February 28, 2008 at 7:19 AM  

Thank God for object aliases. :)

cfSearching February 28, 2008 at 7:28 AM  

Even better than a mute button ;)

Mike Kear February 28, 2008 at 11:33 AM  

Imagine if your client was a furniture manufacturer. Then you could find you have a tblTABLEStable.

Imagine talking about that. How you had to do a query on the table TABLE table table.

Unknown February 28, 2008 at 3:14 PM  

I used to refuse to prefix tables with tbl too :P

The only reason I changed my mind is to make it a little easier to distiguish between a table and a view (I use SQL server mostly) when they have similar names and are being use in the same query, so I prefix tables with tbl and views with view :)

cfSearching February 28, 2008 at 7:05 PM  

@Mike Kear,

Now that is a horrifying thought. I would be forced to call it T^3 .. or we would never get any work done ;)

@Justin Carter,

Yes, I used to prefix views with "v" on occasion. Eventually our dba's habits rubbed off on me. As he would say "That is what the information_schema views are for!" ;) Now he _was_ militant about naming conventions. Even naming tables in the plural made him crazy ;)

Anonymous,  February 29, 2008 at 5:54 PM  

I DO prefix my query recordsets with q... qNewsItem for example. It then becomes VERY obvious that everything appended to that is a table. (except built in cf vars like recordcount)

btw: crazy long captcha

cfSearching February 29, 2008 at 6:59 PM  

@Anonymous,

Well, different strokes for different folks ;)

Unfortunately, I think the blogger reigns supreme over detailed captcha settings, and we just get a choice of on or off ;)

Anonymous,  March 4, 2008 at 5:47 AM  

Hi
arrived here when i was about to make a new table and was asking myself, whats this bleeding tbl good for, except for making it more difficult to find a table(since i cant just hit z to find the zoo-table in a list).
but guess ill just continue to name them tblBlabla since otherwise id break the namingconvention in this miserable system :(

  © Blogger templates The Professional Template by Ourblogtemplates.com 2008

Header image adapted from atomicjeep