| « Prev | Page 1 | Page 2 | Next » |
Re: Classic WTF: A Function to Quit For
2008-12-31 08:04
•
by
Edss
(unregistered)
|
|
I'm crying. Make it stop.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:14
•
by
Micah
(unregistered)
|
|
Obviously if they are ok with this function then they are ok with someone writing the overloads manually, and not even think that someone would use a script. I would be tempted to release an overload once or twice a day, and then use the other 7 hours and 59 minutes for personal reflection.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:23
•
by
Daedalus
(unregistered)
|
|
Oh, I get it! there's a "...+_do+..." typo in the return statement.
What a silly mistake to quit over. |
Re: Classic WTF: A Function to Quit For
2008-12-31 08:26
•
by
Bernie
(unregistered)
|
|
I must be an old, blind programmer because I cannot see the Excel-specific part.
Oh, wait, there it is... "Excel" is in the function name. Now I can die happy and complete. |
|
Besides the glaringly obvious idiocy, what happens if some of the columns don't contain integers? Did the required overloads include "(double a,int b,int c...)", "(int a,double b,int c...)" etc? Because it's New Year's Eve, I can't even be bothered to work out how many combinations would be required. At least it's job security.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:28
•
by
seeker136
(unregistered)
|
|
Actually, _do is a defined variable. Still, quit now. _do not pass go. _do not collect $200.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:36
•
by
meepmeepmeep
(unregistered)
|
|
Wouldn't this require something like (24^2)^(24^2) overloads?
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:39
•
by
Daniel
(unregistered)
|
|
++
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:40
•
by
Daniel
(unregistered)
|
++ |
Re: Classic WTF: A Function to Quit For
2008-12-31 08:44
•
by
dwaz
(unregistered)
|
|
The function returns a long to prevent overflow errors. But all its parameters are ints, and none of them are converted to a long before the addition.
The results of the addition of two ints is an int, so the results of that gigantic addition is still an int, and is still susceptible to overflowing. Only after the addition is it converted to a long. |
Re: Classic WTF: A Function to Quit For
2008-12-31 08:45
•
by
robisjarig
(unregistered)
|
|
I don't believe it. People can't be that stupid
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:47
•
by
jordanwb
(unregistered)
|
Yes they can. |
Re: Classic WTF: A Function to Quit For
2008-12-31 08:48
•
by
mauhiz
(unregistered)
|
|
c+o+m+m+e+n+t
|
|
If only Excel itself had some built-in way of adding stuff up...
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:57
•
by
Kim Johansson
(unregistered)
|
|
Ok... n elements, I'm done.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 08:58
•
by
Dirk Diggler
(unregistered)
|
I think you are correct, everything should be defined as variant. |
|
B A Bay, B E Be, B I Bickey-Bi, B O Bo....
|
|
I love the versioning on this one...Usually, 2.0 signifies that the original developers have a better grasp of what they are trying to accomplish.
"Work dumber, not smarter. No one understands what you're up to, so you might as well not spend too much energy on it..." |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:17
•
by
Joseph Knight
(unregistered)
|
|
TRWTF is that Excel only has IV columns (or 256), so that's 420 variables that they don't have any reason to be dealt with! %264 code bloat even if this had been a good idea to begin with. A preposition is a word to always end every sentence with.
captcha: ideo, as in, what a bad ideo this was |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:17
•
by
Quietust
|
You forgot to initialize "a" to zero. Nice try, though. |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:19
•
by
Pawel Dziepak
(unregistered)
|
Looks like he spent 17 days typing all these 'aa', 'ab', etc ;) |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:20
•
by
JJ
(unregistered)
|
Not quite... you have an uninitialized variable there. |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:24
•
by
Voodoo Coder
|
I remember when I was a freshman in high school, learning BASIC on my TI-82...several of the early "programs" I wrote were, while not quite as abysmal as this, still fully qualified WTF's. I had no idea what I was doing, of course. With zero training and zero grasp of programming fundamentals, it's pretty simple to create this kind of train wreck. It usually comes from power users who have never comprehended code. They write something that works, but is butt ugly, inefficient, and unprofessional. I would be willing to guess this came from a power user who was asked "Hey, can you...." by someone who figures that since they guy taught them how to attach their signature automatically in outlook, he must be a God amongst men who can magically speak to computers. Having grown attached to that rep, the glorified user starts hammering out code. A few short years later, we get to laugh at it, and pray that the writer has since moved away from programming and found a comfortable job providing full time desktop support, or installing broadband, or anything far away from programming. Or, he has at least learned how wrong this was. We all had to start somewhere... |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:29
•
by
Zero cool
(unregistered)
|
|
I can't wait for v3.0 featuring added support for all of excel 2007's 1,048,576 rows!
|
Re: Classic WTF: A Function to Quit For
2008-12-31 09:32
•
by
Drunken Monkey
(unregistered)
|
Wait .. signature in Outlook? Wow ... that would be sooo cool .. I wouldn't need to sign my cheques anymore .. I could just e-mail them to the bank!! |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:33
•
by
Zero cool
(unregistered)
|
|
16,384 columns.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 09:44
•
by
Someone
(unregistered)
|
|
It is C# you don't need to initialize variables.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 09:46
•
by
Monday
(unregistered)
|
Bah, I'll take the pay by line approach. I'd have to write 331,776 functions. I'd be a millionaire!!! |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:47
•
by
Dave
(unregistered)
|
Haven't checked, but I'm pretty sure you do for locals actually. But you'll get a compiler error about it rather than just having a random initial value. Instance fields on a class in C# 2 and later seem to be initialized to 0 by default though. |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:49
•
by
ShatteredArm
(unregistered)
|
Or, even if C# just had a way of taking in a flexible number of items of the same type as the last parameter to a function... |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:49
•
by
Voodoo Coder
|
Shenanigans. Somebody get me my broom. |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:53
•
by
Mike
(unregistered)
|
|
C# initializes integers to 0 automatically. Nice try, though.
|
|
I had a double take when I saw the initials in the code. My initials are BSR and I have used them in code to mark changes I have made. (Except for one other place where I was BSR2, because there were two BSRs in a group of 10 developers) O_o.
Anyway, I didn't commit this felony of bad coding, just wanted to let you know... |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:55
•
by
Druas
(unregistered)
|
|
My eyes are bleeding
|
Re: Classic WTF: A Function to Quit For
2008-12-31 09:57
•
by
halcyon1234
|
Why use a script? Excel has a perfectly cromulant auto-fill function... |
Re: Classic WTF: A Function to Quit For
2008-12-31 09:58
•
by
Anonymous
(unregistered)
|
This is incorrect. |
|
Extensions are friendly
public int addUpAllExcelColumns ( params int[] args ) {
|
Re: Classic WTF: A Function to Quit For
2008-12-31 10:05
•
by
Voodoo Coder
|
Contrary to what some think, C# is not simply VB.NET with a semi-colon on the end. In any event, if C# does do that, would you mind telling my compiler? It seems to think I need to initialize it or something... |
Re: Classic WTF: A Function to Quit For
2008-12-31 10:13
•
by
Zero cool
(unregistered)
|
a very cromulent reference |
Re: Classic WTF: A Function to Quit For
2008-12-31 10:15
•
by
Patrick Harrington
(unregistered)
|
|
Something doesn't seem right on this - Excel only goes up to 256 columns, but the code looks for 702 columns.
|
Re: Classic WTF: A Function to Quit For
2008-12-31 10:22
•
by
Ie
(unregistered)
|
|
C# doesn't initialize to zero by merits of C#, it does it by merit of the resultant .NET IL code. So it doesn't matter if it's source was VB, C#, or whatever.
It is a compiler WARNING in C# that default project warning threshhold converts to an error in Visual Studio 2005 and up. But it's perfectly legal. |
Re: Classic WTF: A Function to Quit For
2008-12-31 10:27
•
by
jimlangrunner
|
Just my $0.02. VB, C#, Whatever. Failure to initialize a variable is a hanging offense. At least in my town. |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:05
•
by
Jeff
(unregistered)
|
|
My version of excel only goes upto column IV, it doesn't allow me to go any further. So why would I need functions all the way upto ZZ?
|
|
Python or any other language supporting keyword params would make that problem a nonissue.
cap: persto |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:13
•
by
Bob
(unregistered)
|
Excel 2007 has more columns. |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:20
•
by
kennytm
|
Probably they're still developing v3.0 now (up to 'zzz'). |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:25
•
by
nate
(unregistered)
|
|
"Excel 2007 has more columns."
But the function was written in 2005. |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:25
•
by
Zero cool
(unregistered)
|
Nice joke. I liked it better when I told it though... |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:27
•
by
danixdefcon5
|
Where's that? Sounds like programmer's heaven! |
Re: Classic WTF: A Function to Quit For
2008-12-31 11:36
•
by
pitchingchris
|
I agree with initializing the variable anyway, its just good coding practice. However, if some of you guys use fxcop to analyze the code, it will warn you if you intialize unnecessarily, such as giving numeric values 0 or types null. Doesn't stop me from doing it though, because I'd rather it be clear. |
| « Prev | Page 1 | Page 2 | Next » |