Results 1 to 3 of 3
  1. #1
    Join Date
    Nov 2011

    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

  2. #2
    Join Date
    Nov 2004
    out on a limb
    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 on the Tiger 800 or the Norton

  3. #3
    Join Date
    Nov 2003
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts