If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > General > Database Concepts & Design > CamelCase VS underscore_method

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-05-11, 15:43
nim6us nim6us is offline
Registered User
 
Join Date: Nov 2011
Posts: 24
CamelCase VS underscore_method

Hey all, in my quest to develop good habits from the start of my programming career I have another query. I notice that there are two methods of coding CamelCase or the underscore_method. While I think CamelCase looks nicer IMO, my only reservation in committing is that the underscore_method let's you save uppercase letters to denote operator or something else meaningful. This seems to tilt the argument to that side just based on efficiency as opposed to aesthetics. I'm interested in efficiency most of all, I want to write code in a way that is universally acceptable, not have to jump between the two, if possible. Or is this another case where both methods have their place in different situations?

Sidenote: I've noticed when it comes to programming getting a Yes or No answer is as elusive as the Loch Ness monster
Reply With Quote
  #2 (permalink)  
Old 12-05-11, 16:06
healdem healdem is offline
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,246
code to the standards used in your organisation.

there is no universal standard that is right, nor is there one that is wrong. what does matter is consistency. yes you can use reverse Hungarian if you wish, but its not the great book its claimed to be, especially if essentially its you doing the coding.

bear in mind that if you do choose to use reverse Hungarian then you need to use a different coding / naming convention for table and column names.. there is absolutely no point in encooding the datatype or prefixing with sundry crap
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #3 (permalink)  
Old 12-05-11, 17:56
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
One of the reason that underscore are widely used, is that for a standard compliant database, CamelCase, CAMELCASE and camelcase are the same table names (because they are not quoted) and would be stored identically in the system catalogs.

From that perspective using underscores (and refraining from quoting names) will make your SQL behave the same across a variety of databases.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On