| « Prev | Page 1 | Page 2 | Next » |
|
This reminds me of a time when a buddy of mine was turning in code for a project in our Machine Learning class. He was getting frustrated with the code one night and put in a comment along the lines of:
//Instantiates your Mom Our instructor, a man with a good sense of humor wrote a comment on the returned code going something like "Good work on the project, and my mother will be happy to know she has finally been instantiated. |
Re: kind of off subject, still bad
2005-03-24 14:54
•
by
rogueRPI
|
|
Do people expect this kind of thing to work? Unless that perl script had a LOT more random subjects and bodies, I'd get suspicious after a week or two when they started repeating (complete with typos). How lazy do you have to be that you can't even write a new email every day? |
|
The function names are hilarious! I especially like WhosYourDaddy(node). Go Pedro! [:D] |
|
I would still give the guy points for ingenuity.
|
|
I never actually saw the emails, but I was suspicious when the manager in charge of catching this years ago repeatedly said the developer in question wouldn't make it to the meeting because he was watching the emails go out.
Yeah right. :P I guess that speaks volumes about the manager, also. But did he get away with it? Yes. Well, until now. :) |
That takes some pretty big balls. I mean, if this is pretty important and he's not really watching the 'emails go out' (WTF?), what if something went completely wrong? |
|
I don't think I would call this person a bad coder. He's a lazy sneak,
yes, but the idea is ingenious enough. Also, the other "interesting findings" aren't really WTFs, are they? Just shows that some coders have a sense of humour. |
Re: theInfamousI and The Responsible Guy
2005-03-24 15:35
•
by
dubwai
|
You might want to re-read the intro. Also, naming your methods and variables jokey names is WTF. Try staying up late trying to debug code with no comments and useless variable and method names and contextless debugging that includes commentary on completely usesless aspects of the process and you'll understand. |
Re: theInfamousI and The Responsible Guy
2005-03-24 15:37
•
by
loneprogrammer
|
Can you figure out WTF RiceCrispies(Snap(Crackle(Pop()))) is supposed to do? I'm not able to see the humour in it when I'm trying to figure WTF is going on, the code is crashing, and the customer needs it fixed *yesterday*. |
|
I am *so* using theInfamousI++ as my default incrementer from now on!!
|
Re: theInfamousI and The Responsible Guy
2005-03-24 16:08
•
by
diaphanein
|
|
My favorite comment from my school days (from my own code) was: // was drunk...will fix later. This comment was followed by a string of variable names containing expletives. Amazingly, despite being drunk, the code worked. Just had to rename the variables before submission. |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:13
•
by
Pragma
|
I think the obligatory first step is: "What do your RiceCrispies() say to you?" It reminds me of when I was helping out other students in my High-School CS class all those years ago. One fellow had a pascal program with variable names like 'a', 'x', 'n' and so on. I suggested that he use "real names" instead of "just letters". He then showed me his revised code with names like "Shaq", "Jordan", "Pete", "Alex" and so on. :'( |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:20
•
by
BradC
|
hehe. As you are walking away, he's probably thinking "real names.... real names, WHY should I put REAL names in my code? Well, I guess he knows better." This is especially tough for people coming to programming from mathematics. In mathematical equations, if you see "ax + by", a, x, b and y are separate variables. In programming, you're just adding two variables. Oddly names ones, but still, just two. |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:21
•
by
WTFPhenom
|
|
What language do YOU use that you can use ++ in your identifier name? I'm a Microsoft guy and I truly don't know the answer to that because MS languages don't allow it.
|
|
Ok, we need to see the ascii image of Trogdor! A google search didn't find anything useful!
|
Re: theInfamousI and The Responsible Guy
2005-03-24 16:25
•
by
BradC
|
I think he just meant that the variable was "theInfamousI". He didn't say it that way, but I also can't imagine any language that would support that as a legal variable name. |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:34
•
by
SOS
|
|
Haha, I love those var/func names [:D] Cool going! Great to brigten up some boring code
|
Re: theInfamousI and The Responsible Guy
2005-03-24 16:39
•
by
JamesCurran
|
Reminds me of something I did in College for a class project. Essentially, just the reverse. It was to process some mathematical algorithm, so I kept the simplic variable names of the original. (One was just "X", and there was a pointer called "ptr"). To document it, a wrote a short story -- a spoof of Sherlock Holmes --- which explained how it worked. There was a "Mysterious Mr. X" and a dog named "Ptr". (If I recall correctly, it was called "The Strange Case of Polly Nomial") I probably still have the listing somewhere...... (Oh, and I got an "A" on it.....)
|
|
Awesome, never again do I have to stay late at work looking at pron, pretending I'm working. Y
|
|
I can't believe I'm correcting WTF code, but what he wants is not
@titles[rand($#titles)] but rather $titles[rand @titles] In a 10-element array, @titles is 10, but $#titles is 9. He'll always miss the last option. |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:49
•
by
mxksweeb
|
That is *awesome*!! I am writing all documentation in the form of prose from now on! I'm glad you got an A on it too--shows the instructor valued creativity (a good skill in programming) as well as proficiency. |
Re: theInfamousI and The Responsible Guy
2005-03-24 16:57
•
by
Kippesoep
|
Not without seeing the code, admittedly, but there is no context here. In the real code there may actually be comments there. As it is, it's funny. |
|
One thing I like to do when naming my local variables is to prefix them with the function name, something like this:
Public Sub MyRiceCrispies( ) Dim MyRiceCrispies_I As Integer Dim MyRiceCrispies_X As String ... End Sub This way you always know what function they came from, and it also helps the compiler optimize your code, making it less likely to confuse them with variables from another function. Anyone else have any variable naming tips they'd like to share? |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:07
•
by
Kippesoep
|
You're describing my very job. (Well, actually, you forgot to add one thing: do this on a live system that allows for maintenance only between 1 and 5am) At least there is a reason behind many of the variable/function names mentioned ("WhosYourDaddy", for instance). Try the ones I have to deal with:
|
Re: theInfamousI and The Responsible Guy
2005-03-24 17:13
•
by
Gooch
|
|
Perl will quite happily allow you to declare $theInfamousI as a variable, and then increment it via
$theInfamousI++ ex: $theInfamousI=0; $theInfamousI++ print "$theInfamousI\n"; -> will print out "1".. I'd have to suspect that's what was really going on with that little gem. |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:15
•
by
Moi
|
You don't know the context. Way to get yer panties in a bunch. A little humour in a small scope is hardly a maintenance issue. |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:20
•
by
fool
|
|
my favorite was in some code a friend wrote that had the whitespace-trimmer KillWhitey()
|
Re: theInfamousI and The Responsible Guy
2005-03-24 17:28
•
by
dubwai
|
Is that Swedish or something? |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:30
•
by
dubwai
|
I can never tell if you are joking with this stuff. I'm just going to assume you are. |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:41
•
by
itchi
|
w w__ |
Re: theInfamousI and The Responsible Guy
2005-03-24 17:53
•
by
loneprogrammer
|
I use ROT13 on all my variable names. For security. |
Re: theInfamousI and The Responsible Guy
2005-03-24 18:01
•
by
dubwai
|
You can always use the characters from the Simpsons. The nice thing about that is that it's almost impossible to run out of names. |
Re: theInfamousI and The Responsible Guy
2005-03-24 18:13
•
by
Free
|
|
RiceCrispies(Snap(Crackle(Pop() ) ) ) Ugh. With a joke name, you know it wont be called from many places so you can just get rid of it. If the names are real-world,use Introduce Explaining Variable.
|
|
I had a function along these lines once... spankthekids() fired from
the controller and rebooted all the child nodes (machine controllers) when they got unruly and nothing but a systemwide restart would do the trick (read: When admin decided we should reboot erverything... just to see if it helps)... |
Re: theInfamousI and The Responsible Guy
2005-03-24 18:39
•
by
Kippesoep
|
|
Hungarian, actually. Problem is, I don't speak Hungarian.
|
Re: theInfamousI and The Responsible Guy
2005-03-24 19:12
•
by
Brian
|
|
Brings a whole new meaning to the phrase 'hungarian notation'
|
|
the Trogdor comes in the NIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIGHT!
|
Re: theInfamousI and The Responsible Guy
2005-03-24 23:38
•
by
Schol-R-LEA
|
|
I have to confess to committing such silliness back in my first
semi-professional programming job, a POS (in both senses of the term) for a store I was working for. The sordid details can all be found here (a slightly different version can also be seen here). Among the groaners were:
Fortunately, I have mostly grown out of this sort of thing, though I do get creative with example code from time to time; for example, I once posted a pair of sample assembly language programs (I was demonstrating how the Netwide Assembler's %include directive worked to a newcomer) named Phant.asm and Org.asm... |
Re: theInfamousI and The Responsible Guy
2005-03-25 01:36
•
by
em
|
|
Re: theInfamousI and The Responsible Guy
2005-03-25 01:38
•
by
em
|
|
Aaargh, your forum software formatted that correctly in the preview, which is definitely a WTF.
Anyway, the point I was trying to make: Scheme has no reserved identifiers at all, and almost all characters are allowed in identifiers. So, "++" is a valid identifier in Scheme... |
|
When I get bored while programming, I also tend to use such names for
variables, methods etc. When I was at the university, I had to write a very boring piece of source. Because I read some very famous comic books at that time ("Werner"), I only used the comic sounds as names. It was fully documented, and the program just did what it was supposed to be, but just reading the source without the comments wouldn't give you a single hint, what this program was supposed to do. |
If it's not too unclear I find it rather funny to do things a little different. (If you don't exaggerate, that is [:D]) All work and no play makes Jack a dull boy... |
Re: theInfamousI and The Responsible Guy
2005-03-25 02:41
•
by
Tom
|
I go one step further -- I use Hungarian Notation. |
Re: theInfamousI and The Responsible Guy
2005-03-25 06:02
•
by
bxc
|
At least Common Lisp and Scheme allow it. |
Re: theInfamousI and The Responsible Guy
2005-03-25 07:04
•
by
Bruce (from Down Under)
|
|
{I think he just meant that the variable was
"theInfamousI". He didn't say it that way, but I also can't imagine any language that would support that as a legal variable name.} Try FORTH or FACTOR to start with, I'm not sure but I think even Smalltalk, and some of the functional languages will allow this. This entire discussion has brought tears to my eyes - it has been so funny. Over the last tweny odd years, the industry has come up with some doozies. Enjoy your weekend Ladies and Gentlemen. |
Re: theInfamousI and The Responsible Guy
2005-03-25 08:12
•
by
JamesCurran
|
OK, I found the list. However, 20 year old computer listings (on greenbar paper) don't OCR very well, so post it, I've had to scan it as images and post the GIFs. If you want to read it, it's at: http://honestillusion.com/photos/the_strange_case_of_polly_nomial
|
Re: theInfamousI and The Responsible Guy
2005-03-25 09:27
•
by
IowaCBR600F4Guy.....can't get my new password at the moment
|
|
That is an awesome story james
|
Re: theInfamousI and The Responsible Guy
2005-03-25 10:10
•
by
Pragma
|
Not only was that a good read, but it had to be the most creative
...although if that was in production (commercial) code, I'd smack you with a trout. 10/10 WTF points. (would've been a '9' but the code obviously predates Trogdor) |
Re: theInfamousI and The Responsible Guy
2005-03-25 10:12
•
by
Fromeo
|
|
The variable names remind me of a program I wrote at one point that
involved a leftist heap (http://www.cs.dartmouth.edu/~chepner/cs15/notes/16_heaps.html). I called the whole structure a commie_heap, and named all the local variables within the implementation after communist leaders, so you'd have functions like: commie_heap_merge(struct commie_heap *lenin, struct commie_heap *trotsky) ...and so on. |
Re: theInfamousI and The Responsible Guy
2005-03-25 10:36
•
by
Blake Miller
|
|
C and C++ would NEVER confuse a local variable with 'another variable from another function'. It just can't happen. If I want to name a local variable the same as something already global, I usually put an l_ in front of the name. There is no need to put the entire function name in front of a variable like you do if writing in C and C++, and it really contributes nothing to the clarity of the code whatsoever. Unless your I or X are used trivially, you would do better to spend your time naming them something other than 'I' and 'X'.
|
| « Prev | Page 1 | Page 2 | Next » |