• gfunk (unregistered)

    Mmm, reminds me of a former programmer who named a variable "blister_me_brandy" in honor of a hot waitress he met at a pancake house. I think it was used as a signal to reset the system.

  • (cs)

    I just women's names for my personal computers. It's a little creepy I s'pose, but my girlfriend doesn't mind.(0)

    It's easier to talk about "Opal" than "The P3-800 I fished out of the trash, cleaned up, installed gNewSense, and am using as a desktop machine" when you have 14 computers.

    "Bessie" > "the Gateway that my doctor friend gave to me after he upgraded" etc.

    (0) I sometimes call her "The Karen" because I already have a computer named Karen. We had a (thankfully humorous) discussion about who had the name first. :)

  • (cs) in reply to Saladin
    Saladin:
    KattMan:
    As for the int myInt; That is a problem only if this int should be for something particular. If it is used later as simply a counter for iteration then I see no reason why you need a better name, of course int myCounter; might have been a better choice.
    I agree with that, my main beef is how so many instructors teach that as the "fallback" name to give anything if you don't know what to name it. Surely /something/ that at least gives some sort of insight into its purpose would be better than "myInt," if only to help readability and make things easier for a new reader to figure out. I mean, why "my" anything? If you're going for simple counters, just use "index" or "i" or something, not "myIndex" or whatever. You're the programmer, of COURSE it's "yours."

    "the "fallback" name to give anything if you don't know what to name it" Man oh man right on! If you don't know what to name a variable, STOP CODING! Don't code any further because you are begining to loose track of what it is you are trying to code. Take a break or look back at the spec. and answer the question; "What is it you are trying to do?" Develop a plan and begin again. The variable name will occur to you naturally. If you write code without a plan, then it's likely to end up on thedailywtf.com and that's what profs. should be teaching!

  • (cs)

    I wonder if he commented these functions so that IntelliDense would give additional info?

  • merreborn (unregistered) in reply to Tigress
    Tigress:
    One just have to wonder what the function Paula does.

    The documentation says it runs a complex algorithm, but in reality, it does nothing, and blocks for a very long time.

    Then it returns 'brillant'

  • KattMan (unregistered) in reply to ssprencel
    ssprencel:
    Saladin:
    KattMan:
    As for the int myInt; That is a problem only if this int should be for something particular. If it is used later as simply a counter for iteration then I see no reason why you need a better name, of course int myCounter; might have been a better choice.
    I agree with that, my main beef is how so many instructors teach that as the "fallback" name to give anything if you don't know what to name it. Surely /something/ that at least gives some sort of insight into its purpose would be better than "myInt," if only to help readability and make things easier for a new reader to figure out. I mean, why "my" anything? If you're going for simple counters, just use "index" or "i" or something, not "myIndex" or whatever. You're the programmer, of COURSE it's "yours."

    "the "fallback" name to give anything if you don't know what to name it" Man oh man right on! If you don't know what to name a variable, STOP CODING! Don't code any further because you are begining to loose track of what it is you are trying to code. Take a break or look back at the spec. and answer the question; "What is it you are trying to do?" Develop a plan and begin again. The variable name will occur to you naturally. If you write code without a plan, then it's likely to end up on thedailywtf.com and that's what profs. should be teaching!

    Fully self contained iterators, who cares what they are called be it I or MySelfContainedIterator, it won't be seen outside the scope fo the function it is in, and it's useage is immediatly apparent when it is used. This argument is a non-argument as it doesn't matter.

    But I agree, most comp-sci student learn the i, a, x names as fallbacks for everything. It's even worse when these are the parameters for a function. I agree, if the variable has any useage outside of a simply iterator there should be some clue what to name it according to the specification and usage. Iterators themselves are almost never mentioned in specs and if they were, you aren't writting spec, you are writting code.

  • KattMan (unregistered)

    I think the forum ate my last post.

  • (cs)

    I generally abhor the "my" prefix as well, but I did find one use for it. I was using JBuilder (a WTF of its own) which puts the bulk of its generated GUI code in a jbInit() method. I got tired of it messing up the changes I would make by hand in that method, so eventually I moved them all out to a method called myInit(). I suppose I could have called it postJbInit() or customInit(), but there's something to be said for the logical and visual symmetry of the two methods.

  • anon (unregistered)

    I bet the guy's a closet gay. He's covering up... "Look how not gay I am! Look how much I love women! I even name functions after them!" Closet case.

  • KattMan (unregistered) in reply to cconroy
    cconroy:
    I generally abhor the "my" prefix as well, but I did find one use for it. I was using JBuilder (a WTF of its own) which puts the bulk of its generated GUI code in a jbInit() method. I got tired of it messing up the changes I would make by hand in that method, so eventually I moved them all out to a method called myInit(). I suppose I could have called it postJbInit() or customInit(), but there's something to be said for the logical and visual symmetry of the two methods.

    This is why I say it is a non issue, something like this is preference, it is neither right nor wrong. The name does give you info as to what it is and that is its purpose.

    As for the OP, the x and y vars are used for something more then iteraters, they have some meaning, but the names don't help. If y was a job index I could care less if it was jobID or MyJobID since it was contained withing the scope of the function. x on the other hand would need to be more like jobID since it is exposed as a parameter; it is exposed outside the scope so it needs more formal conventions.

  • webdev101 (unregistered) in reply to Jim Lang
    Jim Lang:
    So, if I wanted to date Sally, I'd have to get past Trish? Or can I call them both? No, wait, Cassie & Beth look like they're much more fun. Ah, my wife caught me in a fatal exception. She used a Shiv. "goto HELL." Thank God it's not Cobol

    No you just call Trish and she will call Sally, Cassie, Beth and many more... :) This is fun.

    Captcha: shizzle (how appropriate!)

  • David (unregistered)

    Because the Win32 libraries contain a "window" class, that keyword is unavailable for use. Yes, Microsoft in it's infinite wisdom chose to use a word that would almost certainly be used in any application that used the library directly. At my previous company, the window class was then fenetre (french for "window"), and all other windows were sub-classes of it. We didn't want to use MFC or any of that crap because that would have tied us to only the Windows platform, rather than making it at least partially portable code.

    It made it really fun, because we could defenestrate a fenetre. Mostly because defenestrate is a fun word to say.

    captcha: craptastic (aka, the Win32 libraries)

  • Teddy (unregistered) in reply to Benanov

    You should have read RFC 1178, "Choosing a Name for Your Computer".

    No, this is not a joke RFC! Everybody should read that one before choosing a hostname.

  • (cs) in reply to PC Paul
    PC Paul:
    18. Bedazzling Names

    Choose variable names with irrelevant emotional connotation. e.g.:

    marypoppins = ( superman + starship ) / god;

    Oh, I see the problem: this one crashed with a "Divide By Zero" error, right?

  • CleverShark (unregistered)

    [quote]One of my friends told me that of course he would be the Kwisatz Haderach after ingesting that much spice!!![quote]

    hahaha! Oh wait, I don't get it.

  • (cs) in reply to CleverShark

    FYI I don't care what anyone's captcha word is and most other people probably don't either.

  • Ann Coulter (unregistered) in reply to Saladin
    Saladin:
    greywar:
    video Videos[5];
    That annoys me almost as much as

    int myInt;

    That's REAL descriptive, thanks.

    Now we know it's your int and other's should touch it, especially if it's private.

  • BillyBob (unregistered) in reply to SchizoDuckie
    People that use function names like this in production code should be shot, killed, shot again and then hung...

    People are hanged, pictures are hung ;-)

  • (cs) in reply to BillyBob
    BillyBob:
    People that use function names like this in production code should be shot, killed, shot again and then hung...

    People are hanged, pictures are hung ;-)

    They should be hung on the wall as a warning to other programmers.

  • (cs) in reply to foo
    foo:
    Even those names are much better than: OOOOOOOO OOOOOOO0 OOOOOO0O OOOOOO00 OOOOO0OO OOOOO0O0 OOOOO00O OOOOO000

    o_O

  • (cs) in reply to John Hensley
    John Hensley:
    BillyBob:
    People that use function names like this in production code should be shot, killed, shot again and then hung...

    People are hanged, pictures are hung ;-)

    They should be hung on the wall as a warning to other programmers.

    ROTFL!

  • Jonathan (unregistered) in reply to ptomblin
    ptomblin:
    the developers had wanted a VMS stack trace on various error conditions, so they had a "utNNN" function that was written in Fortran that did an intentional division by zero. That seemed stupid to me, and besides, it was in Fortran and I hated Fortran. So I attacked the "Orange Wall" and found sure enough there was a syscall I could make in C that would give me a stack trace without resorting to Fortran. I was so proud.
    Isn't it possible to divide by zero in C without having to resort to a syscall?
  • Sharkie (unregistered) in reply to Henry

    I think the original WTF assumes too much, such as that these functions are modeled after women's names. We've all known a number of men with names generally though to be women's names (Kelly, Casey, etc.etc.).

    These are obviously NOT functions modeled after women or women's names as they simply do not have enough arguments.

  • Earl Colby Pottinger (unregistered) in reply to Javelin
    Javelin:
    PC Paul:
    18. Bedazzling Names

    Choose variable names with irrelevant emotional connotation. e.g.:

    marypoppins = ( superman + starship ) / god;

    Oh, I see the problem: this one crashed with a "Divide By Zero" error, right?

    Remember if programming in FORTRAN that:

    God is REAL unless declared INTEGER.

  • Earl Colby Pottinger (unregistered) in reply to Javelin
    Javelin:
    PC Paul:
    18. Bedazzling Names

    Choose variable names with irrelevant emotional connotation. e.g.:

    marypoppins = ( superman + starship ) / god;

    Oh, I see the problem: this one crashed with a "Divide By Zero" error, right?

    Remember if programming in FORTRAN that:

    God is REAL unless declared INTEGER.

  • (cs) in reply to Rick
    Rick:
    I used to work with a guy named Shiv. All his variables, through his code, would be variants of his name: $Shiv1, $Shiv2, $Shiv3, $ShivTest, etc. Made future troubleshooting nearly impossible!

    I'll occasionally use one or two of those during a debugging session, but always remove them by the end of the session. And I give them better names than that (e.g. ewm_count for a loop counter).

  • Godless (unregistered) in reply to PC Paul
    PC Paul:
    marypoppins = ( superman + starship ) / god;

    => marypoppins == +Inf (division by zero)

  • wfl (unregistered)

    I work for a corp. that names all the servers after employees' kids - we all feel a little sad when one of the admins tells us that Susan died overnight for no reason, but they replaced her before anybody noticed.

  • (cs) in reply to cconroy
    cconroy:
    (Hmm, am I missing something or is there no longer any way to quote the original post without manually copy-pasting?)
          return TrishaEnd( y );
    

    Check out that end on Trisha... is she wearing a thong?

    I dunno, I usually hit the "quote" button in the upper right of the message I want to quote.
  • (cs) in reply to David
    David:
    Because the Win32 libraries contain a "window" class, that keyword is unavailable for use. .....

    What Win32 window class are you referring to? window isn't a keyword, at it is available for use.

  • (cs) in reply to Teddy
    Teddy:
    You should have read RFC 1178, "Choosing a Name for Your Computer".

    No, this is not a joke RFC! Everybody should read that one before choosing a hostname.

    Cute, but less useful now that things like UUCP are long dead and gone. Still useful for servers, but for basic client computers names are nearly meaningless. I just name them by office-dash-user, and take the 10 seconds to change it when someone moves.

    (Unless you have one of those lovely offices where this guy shares out his excel "database", that guy runs sql server express that the mail server connects to, another dude is the office's mp3 repository, and so on.)

  • (cs) in reply to chrismcb
    chrismcb:
    cconroy:
    (Hmm, am I missing something or is there no longer any way to quote the original post without manually copy-pasting?)
          return TrishaEnd( y );
    

    Check out that end on Trisha... is she wearing a thong?

    I dunno, I usually hit the "quote" button in the upper right of the message I want to quote.
    Funny, there doesn't seem to be one of those on the first post...
  • Vexorian (unregistered) in reply to David Green
    David Green:
    Someone's been watching too much Scrubs

    You shut up newbie! (to the admins: this is not a flame)

  • Mr. A Nonny Mousse (unregistered) in reply to Ken
    Ken:
    Remember Jenny defaults to 867-5309
    I wonder what incident report PE6-5000 is?
  • Hank Miller (unregistered)

    How timely. I was just working with a function called GoDoTheVooDoo()

    The weird name didn't bother me so much as the variable passing convention we use here: pass by global variable.

  • BOB (unregistered) in reply to John Hensley

    When I first learned programming at uni in 1972 we had an alphabet of A B for real numbers and I J for integers, and all the digits. We could use A1 A2 B6 B7 and so on. Someone complained, and the lecturer joked that it was to stop people using rude words. I commented that 'B-zero-zero-B' (B00B) was possible. He never liked me much after that.

  • SuzieQ (unregistered) in reply to Jonathan

    In fact VMS had the ability to not only trigger a stack dump, but to then unroll the stack a specified number fo frames and continue. All of these are controled by system calls available from any langauge.

  • Graham C (unregistered)

    As the original submitter, I should mention that Derrick has somewhat editied the code and the explanatory text - to a much funnier effect I might add. The code in question was in reality 6800 assembler, and the comments were very few and far between. So no, there was no descriptive header saying what each Sally, Beth or Cassie did, to any useful degree anyway. AFAIK, the guy wasn't gay and hence overcompensating (though as he's since become some sort of politician who knows?). My own theory is that due to his unfortunate physical ugliness it was his way of having a sort of harem at his beck and call. The code in question runs in a very common consumer electronic device fitted in many homes in the UK and elsewhere... alarming!

  • cklam (unregistered) in reply to Benanov
    Benanov:
    I just women's names for my personal computers. It's a little creepy I s'pose, but my girlfriend doesn't mind.(0)

    It's easier to talk about "Opal" than "The P3-800 I fished out of the trash, cleaned up, installed gNewSense, and am using as a desktop machine" when you have 14 computers.

    "Bessie" > "the Gateway that my doctor friend gave to me after he upgraded" etc.

    (0) I sometimes call her "The Karen" because I already have a computer named Karen. We had a (thankfully humorous) discussion about who had the name first. :)

    14 boxes - Man, I don't want to have your electricity bill. As for naming - I use the names of planets and moons.

  • secret (unregistered)

    truly, an object oriented programming =)

  • D (unregistered) in reply to John Hensley
    John Hensley:
    BillyBob:
    People that use function names like this in production code should be shot, killed, shot again and then hung...

    People are hanged, pictures are hung ;-)

    They should be hung on the wall as a warning to other programmers.

    And be made to sing 'I will survive'

  • Franz Kafka (unregistered) in reply to John Hensley
    John Hensley:
    o_O

    There, you're getting it!

  • Franz Kafka (unregistered) in reply to wfl
    wfl:
    I work for a corp. that names all the servers after employees' kids - we all feel a little sad when one of the admins tells us that Susan died overnight for no reason, but they replaced her before anybody noticed.

    Did anyone else think to themselves "she died, but we got another one that looks Just Like Her!", followed shortly by "THAT'S NOT SUSAN!, WAAAH!".

    /evil

  • Bill Timmins (unregistered)

    My favourite function names were in the system scripts in the Apollo Domain system (c 1985). When they needed a throwaway function in a script they usually called it hunoz or hukairz (say it out loud).

    (nice brown captcha - chocobot)

  • Adrian Zanescu (unregistered) in reply to McCorvey

    Bear in mind that maybe a lot of us are not native english speakers so i donno if grammar is to be an issue.

  • Adrian Zanescu (unregistered) in reply to CleverShark

    [quote user="CleverShark"][quote]One of my friends told me that of course he would be the Kwisatz Haderach after ingesting that much spice!!![quote]

    hahaha! Oh wait, I don't get it.[/quote]

    I suggest you run to the nearest bookstore and buy a copy of Frank Herbert's "Dune" (all 6 of them :-)).

  • Holy Roly (unregistered) in reply to Javelin
    Javelin:
    PC Paul:
    18. Bedazzling Names

    Choose variable names with irrelevant emotional connotation. e.g.:

    marypoppins = ( superman + starship ) / god;

    Oh, I see the problem: this one crashed with a "Divide By Zero" error, right?

    No, marypoppins = 0. god is infinite.

  • Phill (unregistered) in reply to me
    me:
    Jim:
    Cirdan:
    Earl Purple:
    And so, Sally can wait.
    She knows it's too late
    As we're walking on by
    Her soul slides away
    But don't look back in anger
  • xyz (unregistered) in reply to Phill

    I heard you say

  • Ralf Engels (unregistered) in reply to KattMan
    KattMan:
    Saladin:
    greywar:
    video Videos[5];
    That annoys me almost as much as

    int myInt;

    That's REAL descriptive, thanks.

    I honestly do not see the problem with the video Videos[5] as it shows you that a video is a single instance but the plural is a collection or list of some sort. I agree it would be helpful to know which of these types of objects it was, but still it is descriptive without being verbose.

    I am doing this thing quite often. Sometimes a video is simply just a video. Or do you want to call it myVideo all the time? One thing though. You should have a naming scheme. Following the Java naming scheme all class names start with a capital letter.

    If you follow this scheme something like MessageBox messageBox; is no problem. The difference is obvious and even if you get something wrong, then the compiler will catch it.

Leave a comment on “Little Black Book”

Log In or post as a guest

Replying to comment #:

« Return to Article