- 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
LOL! This was great. But I think it would make a better end as:
Admin
So? The standard might have been written on April 1, but it is dead earnest and completely sound. Software that complies will have calendars forever!
Admin
OK so we're testing the case where the system clock has an invalid date. WTF - bigger problems there.
Admin
Admin
Admin
Admin
Admin
Admin
Also known as the Mayan GOTO.
Admin
Admin
Why?
You wanna Know why?
F*** YOU THAT'S WHY!
Awkward code is awkward...
Admin
look like jason has talent in several software language
PL/SQL, Java, JavaScript, Ruby.
Admin
The real WTF is allowing your mission-critical software to be written by BASIC programmers.
Admin
I'm still pretty comfortable with a 2 byte year for my date. I'm not gonna be around in 65535 when the ball drops anyways. (or 32767 for that matter if its signed... but what idiot wants a negative date.)
Admin
Are you accusing prehistoric man of being unintelligent? I'll have you know we oldsters are just as clever as some of you young buckoes. Now get off my lawn.
Admin
I'm old enough to own my own house... You get off MY lawn!
Admin
No, it was a debugging tool. At some point, you need to test the "invaliddate" code, so you write in a specific bomb to test it with.
Unfortunately, the developer forgot to take the bomb back out.
Admin
Admin
The real end of the world won't come until approximately July 16, 2013. That's when I estimate that the odomoeter in my pickup will reach 99,999 + 1.
I don't see why we should go by when some obscure ancient calendar rolls over. I think my truck's odometer is much more relevant.
Oh, wait, hang on while I check when the hit count on my web page maxes out ...
Admin
How so? 2012 is a valid date. Unless you have a specific reason for deactivating the software at 2012, there is NO reason for that line of code. What else could you be testing for by shutting down the software in 2012.
Also, the software will work again in 2013 since its a simple = and not a >. Maybe someone went mayan and decided that an inequality wasn't necessary.
Addendum (2012-01-03 14:12): Looking back you should be able to test it (without this specific line) by just it against an obvious bad date (1756 or something) without even using that line of code.
Admin
Admin
We can just add another bit and we'll be good for another 68 years.
Admin
I don't know about any of you, but my own calendar (the one I have on my wall) ends on December 31st.
Actually, it seems to acknowledge that there may be an additional 31 days in a month it calls "January," but these 31 days are printed in a tiny box in December's schedule, as if it were just a footnote. Maybe it's conceding that it may be 31 days off in predicting the end of the world.
Admin
Obviously, you haven't read up on the impending end of the world due to MayanCalendarOutOfDaysException. It's supposed to break EVERYTHING on December 21.
You really should read up on it because, beginning on December 22, you need to join the rest of us in leading every conversation back to the Mayas, in order to annoy those who don't want to talk about anything Mayan, ever again.
(Also known as: Those who won't learn from history are doomed to be reminded of their failings by those of us who do.)
Admin
Admin
Because... Fuck You
Admin
Now that I've done my Fortran part, I was entering a nice date in a spreadsheet yesterday, and since it was Jan 2, and the field was setup to be a date (it puts in the year automatically), I entered "1/2". Excel in its infinite wisdom decides that the proper form is the single 1/2 character. Then I realized that it is Microsoft, and said, "It never ends" and decided that punching out my computer would ruin it for all the other intelligent programs and decided against it.
Sorry for NOT typing in the single character 1/2 but it really isn't on my keyboard, and this browser doesn't change things capriciously.
Admin
Admin
Results of Search in US Patents Collection db for: PN/20060073976: 0 patents.
:(
Admin
Somebody already started it, and it's due for release in 2012.
Hi Akismet. How are you?
Admin
Obviously it was there to close a 'hacker' trick
by setting your computer clock forward say to 2020, when you enter your license for 30 days, it becomes a negative quantity once the time reverts to the systems normal date.
Congratulations, you just re-enabled the hackers hole in your licensing system.
Admin
I agree. The recklessness of the OP would be inexcusable in any truly professional team, and by removing a layer of security, the poster (assuming the story is not fantasy) may well have put their own position in jeopardy. This post betrays the very cowboy attitude that fora such as this attempt to discourage. The first step of a true team player would be to contact the CTO for instruction. Always assume your superiors earned their superior positions for a reason. Also, the world is gonna end this year. Everybody knows that.
Admin
Fixing this should obviously have been put off until next year.
Admin
Admin
What continually annoys me is how Excel will try to interpret everything as a date. I once was trying to create a spreadsheet that included part numbers. Our part numbers had hyphens in them. So I typed in "1-2-04". Excel promptly rediplayed this as "01/02/1904". Umm, thanks.
Admin
Back in January 2000 -- right after all the predictions of the world ending on January 1 had proven to be false -- the pastor of my church commented that if you had a need for an electrical generator or a large supply of canned foods, you could probably get them at a discount now.
Admin
maybe its one of those WTF where someone had to modify the year every single year to the next year
Admin
I actually put a very similar line into some licensing code I was maintaining, except it was set to arbitrarily fail in the year 2035 and had a big, all-caps comment right before the offending line saying, "This code has the 2038 unix time bug! You have three years to fix it!"
Admin
What? You want those guys writing in a language without training wheels? Seriously, Visual Basic and Java exist for a damn good reason.
On the other hand I've seen stuff where, Eddy is working on some code and gets called into a 'meeting' by his boss, then finds himself in the parking lot 15 minutes later. And the code he was working on gets slopped into production with nary a glance.
Admin
Some idiot was testing if the INVALIDDATE routine works as intended, and they added that, while also setting the date to 2012 whereever the date-input is coming from. They picked 2012 randomly, as there are no licenses tied to 2012 at that time. They the same idiot forgot to remove that code. That's how that came to being.
I haven't actually read all the comments just yet - in case somebody already stated this.
Admin
This is what happens when you outsource to Mayan subcontractors.
Admin
The Mayans put that line of code in there. >;->
Admin
I was tasked with developing a database in Access XP/VBA. Whenever dates were inserted via code, a date like "20/12/2004" would be helpfully changed to "12/20/2004". Apparently it was a JET thing. Given that MS consider JET deprecated, did they fix that?
Admin
Yes, but nobody ever uses that command. :^)
Admin
[quote user="Tom"][quote user="Melnorme"]Unfortunately, the developer forgot to take the bomb back out.[/quote]
That's why it's always a good idea to comment the code, even if you're only planning to use it for one build:
if (year == 2012) goto invalid_data; // TEST ONLY FOR THE LOVE OF GOD REMOVE THIS ASAP!
Admin
First of all "Happy newyear" second "GOTO?????
Admin
Admin
We encountered something similar in 2010 with an SQL and PHP online form. In the code it specified that the year must be less than 2010. The notes said, "Ambitious, aren't we?" Since it was created in 1999, then yes, yes that was ambitious. We changed it to 2100 and left the note in.
Admin
Agreed, that's what got me about it to - even if it's a codebomb, it's a bad codebomb.
Admin
On my first computer job out of college, I ran into a line similar to that one - the same test on the same year to return an invalid date flag, but it was written in a different, proprietary language which I shall not name.
I followed up with the guilty coder after he returned from holiday, and his first response was, "Why the hell were you looking at my code? You're not even on my team!"
After explaining that his backup couldn't understand his code, despite having checked off that he'd reviewed it and found it acceptable, and his two team members who were in town were also unable to understand his code, so his backup called the one guy who got a 100% on the test at the end of the training they'd given us on the proprietary language in question. And, while I also thought his code was monkey shit, and no wonder he got support pages all the time, I was able to read it and was not amused. But I could see some misguided sense in all of the other abuses. Since I wasn't on his team, it wasn't that big of a deal to me. But I did want to understand this bit of insanity.
Finally, after I threatened to talk to our boss (he was on another team, with a different team lead, but we both worked for the same contracting company, which expounded at length to all of us how our work quality mattered, and we shouldn't leave festering piles of crap code for our customers like he was doing, and we reported to the same guy at the contracting company, since we were on the same project) if he didn't tell me what was up with it.
He said, "When I was in school, I had a professor who always tested out of range dates with a random date in 2012. So I learned to always write a check for it."
Epilogue: after he was fired, somebody mentioned to his customer team lead that I was the only one who was able to read the guy's code. So, I was given the task of cleaning it up. Since it wasn't my team, I wasn't going to have to support the results, and we had a test environment, oh, and I was crazy, I used a giant sed script to convert all of the simple stupidisms he used to more legible versions. I then tossed the output to the poor sap who was tasked with supporting the crap. I described it as "here's my first stab. I didn't spend much time on it since nobody in either of my chains of command authorized me to bill for it." He thanked me for the output, calling it much more legible and stable than the original. (For those who didn't get it, I'm not saying I'm the man, so much as I'm saying the code was so bad a blind sed script was able to improve it. Note that the sed script did need to be uncaring about legal case variations and whitespace, because the only thing he was really consistent in was writing bad code.)
PS, actually, I had talked to our shared boss at the contracting company before he was fired (I hadn't said that I wouldn't talk to the boss if he told me; I merely said that I would if he didn't.) Said boss indicated he'd heard similar from his other coworkers, and since he'd heard the same thing from three people, he had a talk with the guy. The guy refused to change. Our boss was not willing to fire him before the customer did, however. But because three of us had talked to the boss about him, and we all indicated he didn't improve, when the customer fired him, our boss fired him, too.
PPS, I can't remember enough to post, and it would be difficult to do so with proper anonymization anyway, due to the peculiarities of that language, and how fundamental to them some of the issues were. He wasn't a bad coder because of not understanding the language nearly as much as he was a bad coder because he understood the language far too well, without understanding why not to do things the language made possible, and because he never checked for error returns.