- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
I'm crying. Make it stop.
Admin
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.
Admin
Oh, I get it! there's a "...+_do+..." typo in the return statement. What a silly mistake to quit over.
Admin
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.
Admin
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.
Admin
Actually, _do is a defined variable. Still, quit now. _do not pass go. _do not collect $200.
Admin
Wouldn't this require something like (24^2)^(24^2) overloads?
Admin
++
Admin
Admin
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.
Admin
I don't believe it. People can't be that stupid
Admin
Yes they can.
Admin
c+o+m+m+e+n+t
Admin
If only Excel itself had some built-in way of adding stuff up...
Admin
Ok... n elements, I'm done.
Admin
Admin
B A Bay, B E Be, B I Bickey-Bi, B O Bo....
Admin
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..."
Admin
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
Admin
You forgot to initialize "a" to zero. Nice try, though.
Admin
Admin
Not quite... you have an uninitialized variable there.
Admin
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...
Admin
I can't wait for v3.0 featuring added support for all of excel 2007's 1,048,576 rows!
Admin
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!!
Admin
16,384 columns.
Admin
It is C# you don't need to initialize variables.
Admin
Bah, I'll take the pay by line approach. I'd have to write 331,776 functions. I'd be a millionaire!!!
Admin
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.
Admin
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...
Admin
Shenanigans.
Somebody get me my broom.
Admin
C# initializes integers to 0 automatically. Nice try, though.
Admin
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...
Admin
My eyes are bleeding
Admin
Why use a script? Excel has a perfectly cromulant auto-fill function...
Admin
This is incorrect.
Admin
Extensions are friendly
Admin
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...
Admin
a very cromulent reference
Admin
Something doesn't seem right on this - Excel only goes up to 256 columns, but the code looks for 702 columns.
Admin
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.
Admin
Just my $0.02. VB, C#, Whatever. Failure to initialize a variable is a hanging offense. At least in my town.
Admin
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?
Admin
Python or any other language supporting keyword params would make that problem a nonissue. cap: persto
Admin
Excel 2007 has more columns.
Admin
Admin
"Excel 2007 has more columns."
But the function was written in 2005.
Admin
Nice joke. I liked it better when I told it though...
Admin
Admin
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.