Hungarian Notation Gone Too Far


  • ♿ (Parody)

    @bstorer said:

    @asuffield said:

    @bstorer said:

    Why, then, do both Ruby and Python go_with_underscores?

    Because camel case fails in the presence of acronyms. Consider something like CORBAXMLWWWWrapper. Camel case is ambiguous, underscores are not.

     

    Yes, but the underscore key is all the way up there (I am now pointing at the top right of the main body of keys).  it_really_sucks_because_thats_a_pinky_key.  thisIsFarEasierForMe (maybeBecauseImLeftHanded?).

     

    I read variables more often than I type them.  camelCasingIsMuchHardertoReadForMe than_a_bunch_of_stuff_with_underscores. 



  • Have to disagree...when I read stuff separated with underscores the voice in my head goes.  All.  Swampy.  And.  Interrupts.  My.  Train.  Of.  Thought.

    Camel and Pascal casing read perfectly naturally to me though.  Also I do think the underscore is a pain to type (I'm on a UK keyboard, maybe it's in a different place on US keyboards?)


  • ♿ (Parody)

    @upsidedowncreature said:

    Have to disagree...when I read stuff separated with underscores the voice in my head goes.  All.  Swampy.  And.  Interrupts.  My.  Train.  Of.  Thought.

    Camel and Pascal casing read perfectly naturally to me though.  Also I do think the underscore is a pain to type (I'm on a UK keyboard, maybe it's in a different place on US keyboards?)

     

    It's right next to the zero on a US keyboard.  It requires a shift, but then so does a capital letter.   I can hit it with my right ring finger, so it's not so tough.


  • Discourse touched me in a no-no place

    @boomzilla said:

    It's right next to the zero on a US keyboard.  It requires a shift, but then so does a closing parenthesis.
    Closer to what you probably intended to get across. HTH.


  • ♿ (Parody)

    @PJH said:

    @boomzilla said:
    It's right next to the zero on a US keyboard.  It requires a shift, but then so does a closing parenthesis.
    Closer to what you probably intended to get across. HTH.
    No, I said what I meant and I meant what I said.  I was comparing using lowercase and underscores with using camel case.  There are no closing parenthesis in camel case, but there are upper case letters, which usually require a shift, unless you like toggling the CAPS lock for each key, which would be TRWTF.



  • The camelCase scheme is just fine for acronyms.  If the acronym is 3 letters or more, then it's written out as a normal word, with only the first letter capitalized.

    I suppose it's still possible to have a "WSKBRMFSDBContext" or something stupid like that, not that I've ever seen it, but that's why some conventions don't even have the 3-letter rule, they just camel all acronyms, period.

    Think of it this way: if you're going to use an acronym in your code at all, you'd better be damn sure that it's a well-known one (everybody has at least some vague idea what "XML" and "SOAP" are).  If the person reading your code already knows what the acronym stands for, and hence would be able to recognize it in the middle of another compound word, then there's really no need to have it in uppercase.

    And indeed, it's much easier to read CorbaXmlWwwWrapper than CORBA_XML_WWW_Wrapper.  Ugh, that underscored version is hideous.

    I suspect the real reason some programmers and language designers keep using underscores is just bad habit carried over from the days when some filesystems didn't allow spaces in paths, and in some cases weren't case-sensitive.

    <hints id="hah_hints"></hints>

  • ♿ (Parody)

    @Aaron said:

    And indeed, it's much easier to read CorbaXmlWwwWrapper than CORBA_XML_WWW_Wrapper.  Ugh, that underscored version is hideous.

    I suspect the real reason some programmers and language designers keep using underscores is just bad habit carried over from the days when some filesystems didn't allow spaces in paths, and in some cases weren't case-sensitive.

     

    Really?  I can actually read the underscore version quickly.  I have to stop and slowly scan the camel case version.  So I can tell you that some of us like to use it because the camel case doesn't just look hideous to us, but it's hard to read. 



  • @Aaron said:

    I suspect the real reason some programmers and language designers keep using underscores is just bad habit carried over from the days when some filesystems didn't allow spaces in paths, and in some cases weren't case-sensitive.

    IT_WAS_DEFINITELY_THE_ONLY_WAY_TO_SEPARATE_WORDS_IN_VARIABLE_NAMES_IN_COBOL.


  • I really don't care about casing conventions. I'm happy with good, well-designed code in any casing style. The biggest proponent of casing conventions here apparently doesn't follow them correctly, anyways. So that shows how helpful those are.

    When I'm in charge of a project I just use lowercaseonly for most everything. At least that way I can avoid arbitrary confuddlements like Schoolbook vs. SchoolBook vs. schoolBook vs. schoolbook.

    But to be honest I've never had trouble jumping from one project to another with alternating styles.

    I just want names that sanely indicate what they do or what they contain. Unfortunately that's very, very rare.

    And as for hungarian, can't you just mouseover an identifier to see its type? Who needs to be reminded of the type every time you read/write the name? Not to mention you can't trust those prefixes, anyway.


Log in to reply