- 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
TRWTF is not the code -- it's that it was able to be committed
Admin
And those wrong answers would have been more than just inaccurate - there would have been letters used for some of the digits. If those kinds of bugs can go unchecked for so long, I wonder how much more WTF-ery is at that place.
Admin
Admin
Admin
Admin
i got 2 32 inches monitors :P
Admin
I don't quite grok this WTF:
By using atoi with the wrong base, users had numerical results that contained letters and didn't complain ? And the sofware went throught several revisions, with more and more letter cropping into results (at the end, almost 25% of the numerical symbols would be letters).
Now, if we were talking about itoa, I would understand that the results would be worse and worse... (ie: 10 in the input beeing replaced by 13, etc, etc)
Admin
Ridiculous. Certainly not if Base 13, like Base 16, would use A, B, and C.
Ahem. In the pattern of high-schoolers everywhere who've learned they can turn their calculators upside-down...
B00B135!
Admin
Admin
There are many things often change that should be configuration options.
There are many things that rarely change that should be in global headers.
Then there are things that do not change, like the frickin base the entire world operates in. The world will not be moving to base 12 or base 60 anytime soon. Anyone who thinks 'the base we operate in' shouldn't be a 'magic number' is insane.
But, seriously, this was actually pretty much has to have been a stupid search and replace. Although the sort of idiot would search and replace '10' is unknown, nor what other horrible things that resulted in. (They probably had to manually fix all the ones that wouldn't compile.) Someone should probably search for 'VERSION_CODE' and check each use of it.
Also, the fact this wasn't caught immediately in 2006 does not bode well for quality control.
Admin
I'm going to say the WTF here is in the original developer who didn't use a macro for what eventually turned into VERSION_CODE.
Fixing all the magic numbers, if you have no idea where they all are and there a millions of line of code to inspect, is NOT going to be a fun fix and I can understand that one of these slipped through the net (the function could have been so rarely used and the output deviation so minor that unit testing didn't pick it up. Although, it's hard to defend this slipping through a review).
Admin
We are talking about
, or does your article read differently to everyone else's?On topic, this is a WTF of note. Using a non-standard library function? Check. Using an obscurely-named constant as a parameter to that function? Check. Using zero common sense regarding said constant? Check, check, and check.
Admin
Nah, I guess at one time they were replacing the literal 10 with VERSION_CODE and didn't check if there were places where the literal were not used in a VERSION_CODE context
Admin
Perhaps the developers were simply trying to discover the Ultimate Question of Life, The Universe and Everything? (6 * 9 = 42)
Admin
I've always said there was something fundamentally wrong with the universe.
Admin
I'm pretty sure that's exactly how it happened but all it would take is the programmer who did the search and replace to not understand itoa and the QA people not understanding it either.
Admin
Admin
Heck no dude that's insane. No way man.
JT http://www.Privacy-Center.Net
Admin
Well played, sir. Well played.
Admin
Am I too young to know what a seiboob is? On the other hand, five million, three hundred eight thousand, eight makes me giggle.
Admin
Isn't the real WTF that it took 3 years for this bug to be fixed? I figure in 2006 when the bug became evident they (the company) would try to track down the issue and fix it.
Admin
I messed up in the comment. I meany the opposite:
the code is about itoa (integer to ascii) so they have letters in number and did found that. I don't believe it.
if the code was about atoi (ascii to integer) then I can understand how the result would be wrong, with "10" beeing intepreted as 13.
Admin
Assuming you were being serious...
"I didn't even know that there was a third parameter to itoa() in the first place. Why?"
Erm, because who says what text format is the right one for representing a number?
"Using itoa() at all is a bit of a WTF in itself. It's not like it does anything that sprintf() doesn't do (apart from print numbers in base 13, obviously), and it certainly does a lot less."
Interesting point; I think you're correct in one way, that itoa() is not standard/portable but sprintf() is. On the other hand atoi() is potentially much faster / less resource hungry (remembers horrible ancient embedded libraries where sprintf() filled up much of the available space) than sprintf(), also sprintf() can't handle all base formats up to 32 (normal upper limit).
Admin
I know you are trying to be funny, but that function is wrong. It would say that -0.0 is not negative, thereby failing the one test that I'm guessing is the point of the whole function...
Admin
Actually, because you are changing the base, it gets smaller every year. ;)
Admin
Thanks Michael - I had NO idea what this one was on about.
Admin
Could the real WTF be that this could have been a malicious attempt by a previous developer who has left/been sacked/etc. to let the product derail itself slowly as time goes by?
The fact that it went undiscovered for 2 years seems like they didn't care about the quality of the product for a while until someone really complained hard?
Admin
For those who don't see the WTF: Stop (C/C++) programming. Others should to it for you ;-)
Admin
42" FTW. PROOF
Admin
Dolor: Spanish word for 'pain.' As in: I have a dolor in my tanus.