• bull (unregistered)

    If IAmTheCurrentBossOfThisParticluarGuy MyF_ckingAwsomeCompany.WouldFire(ThisGuyWhoDoesNotKnowHowToCode,Now&&Forever&&Ever)

  • TD (unregistered)

    I once had the pleasure of maintaining some code developed by another programmer. I don't remember exactly what language it was, but suffice to say it was case-sensitive for variable names. Another "cute" characteristic of this programmer was that he was a HUGE fan of Pink Floyd.

    His code ONLY contained variables whose name had something to do with Pink Floyd. Unfortunately, and I can only blame Pink Floyd for this, they didn't have enough song names or album names, so the developer resorted to uppercase/lowercase.

    Sample Variable names:

    TheWall tHeWall thEWall Pink pInk piNk pinK Floyd FlOyD

    and so forth. And obviously each one of these variables had a different purpose.

    That was fun !!!!! NOT !!!!

  • jokergirl (unregistered)

    Well, intellisense is all nice and good, but long names have actually caused some bugs for my company.

    We have a bunch of interface functions between different parts of the code, as well as private interface functions that are called by them sometimes. For a while that was done by "#define Get_IncrediblyLongAndStupidVariableName_public() Get_IncrediblyLongAndStupidVariableName_private()".

    Sometime after a corporate decision made us rewrite all of them into INLINE function calls instead, our programs started to crash immediately after start.

    What happened?

    INLINE int Get_IncrediblyLongAndStupidVariableName_public() { Get_IncrediblyLongAndStupidVariableName_public(); }

    Copy&paste FTW! Since everybody copied and pasted the incredibly long function names for tons of variable names, many forgot to change public to private in some of them. So we had quite a bunch of recursive loops all of a sudden...

    ;)

  • jokergirl (unregistered) in reply to jokergirl

    sneakily goes back and sticks a "return " into above code

    Sorry.

    :(

  • DiDYaBringYaBeerWithYa (unregistered)

    hmmm, I wonder what code the breweries have in there systems????

    public abstract class AbstractDidYaBringYaBeerWithYa { ... }

    public class FostersFullStrengthWith4PercentAlcohol extends AbstractDidYouBringYaBeerWithYa { .... }

  • Twey (unregistered)

    I once heard of a programmer who enjoyed naming variables according to how they were derived:

    int totalDIVIDEDnetMINUSthree = total / net - 3;
    
  • Padraic (unregistered)

    Once upon a time, I was a VB (pre-.NET) programmer for a small company - at our peak, we had three programmers, and we were a software company - and got into an argument with the "senior" programmer for the company over meaningful function names.

    I wrote a single, all-purpose subroutine to slap one or two fields of a table into a listbox control (the ItemData property of the entry being optional):

    sub LoadList(sQuery as String, sItem as string, optional sItemData as string)

    Simple, easy, and it was informative: You slapped in a query, then told the subroutine what to put in the list, and, if necessary, what to put in the ItemData property for that list item. It was, like, six lines long.

    He was put in charge of putting together a global library for all programmers to use, and replaced my five line subroutine with two subroutines:

    sub PopulateListFromRecordset(sQuery as string, sData as string) and sub PopulateListFromRecordSetWithItemData(sQuery as string, sData as string, sItemData as string)

    I told him that under no circumstances was I going to type "PopulateListFromRecordSetWithItemData" between two and twenty times per form, and he told me I had to implement his solution. So I did: my LoadList function checked to see if sItemData was empty, and called his functions appropriately.

    It was a needless call, except inasmuch as it prevented me from getting carpal tunnel...

  • Padraic (unregistered) in reply to Padraic

    WHUPS!

    I forgot - as the names implied, PopulateListFromRecordSet and PopulateListFromRecordSetWithItemData required a RecordSet, not a SQL query, because lord knows you can't pass a query within a function even if the entire purpose of the query is to get data for the function. Sheesh.

  • Joe (unregistered)

    How about this:

    fetchImgReferenceByFilenameAndWriteResponse(paramValueForFetchingImgReferenceByFilename, req, res);

    5 or 6 lines later:

    fetchImgReferenceAndSourceByFilenameAndWriteResponse(paramValueForFetchingImgReferenceAndSourceByFilename, req, res);

    I get the WTF feeling every time I run into this kind of names in our project...

Leave a comment on “Really Descriptive Names”

Log In or post as a guest

Replying to comment #:

« Return to Article