• (cs) in reply to herby
    herby:
    BentFranklin:
    The Mayans correctly predicted the end of the world in 2012, due to GOTO statements.
           GO TO 2012
    2012   CONTINUE
    
    (I couldn't resist).

    LOL! This was great. But I think it would make a better end as:

    2012   GO TO 2012
    
  • (cs) in reply to Pim
    Pim:
    m:
    No, the problem of ending calendars was solved in RFC2550 once and for all. There is no escape from the world anymore.
    Haha, that RFC was written on April the first. I'm not falling for that one! Anyway, you say there's no escaping the world, but I can try.

    \w\o\r\l\d

    There.

    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!

  • 8bit (unregistered) in reply to lolwtf
    lolwtf:
    Go ahead and set your system clock to the year 1854 and let me know how it turns out.

    OK so we're testing the case where the system clock has an invalid date. WTF - bigger problems there.

  • CoSYG (unregistered) in reply to 8bit
    8bit:
    lolwtf:
    Go ahead and set your system clock to the year 1854 and let me know how it turns out.

    OK so we're testing the case where the system clock has an invalid date. WTF - bigger problems there.

    I can only get 1980 to 2099. Test case skipped....
  • Poster (unregistered) in reply to 8bit
    8bit:
    You need that kind of statement to test the error case.
    Wouldn't a real invalid date be better? 1854 or something.
    Sure. But who knows what other checks might have prevented that from appearing in the license key? We're just looking at a single line of code. Besides, I'd also prefer to think ahead instead of back ;-)
    Otherwise what are you testing?
    You're testing the code that writes "invalid date" into the log file.
  • (cs) in reply to F
    F:
    Omnifarious:
    My guess is that this was someone's ham-fisted attempt to keep people from entering dates that were 'too far' in the future.

    If you have good source control you could figure out when that line was added and if there's a decent change comment about it.

    Addendum (2012-01-02 17:06): Which means that 'the real WTF' here is the fact that apparently the person who fixed this problem wasn't able to figure out why the change was put in in the first place using source control.

    You can have the best source control system in the known universe, but someone stupid enough to insert a line like that and leave it in production will almost certainly have put a completely bogus (or unintelligible) explanatory comment.

    Not to mention that there are workarounds for it. Nasty, nasty, horribly nasty business when that happens. Been there (and probably plenty of us have been), cause someone put some code into production without passing SVN -- code I didn't have, while it's my responsibility to maintain the codebase. Only found out later when the guy responsible for the production server told me: "Oh yeah, that stopped working because that guy added some code you don't know anything about." All the source control in the world won't save you from such issues then (except when you say: "Well, screw it, he's got to pass SVN. I told him before that his changes'd be removed if he doesn't, so lo and behold, with the next build, his changes are gone" -- unless if he then again adds it to production after that...)

  • (cs) in reply to some guy
    some guy:
    TRTDWTF:
    int days_in_december[15] = { 2, 5, 6, 8, 9, 12, 14, 15, 16, 19, 20, 22, 27, 29, 30 };
    
    Officially welcome to the-less-than-half-daily-wtf.com.

    Let it go, man, the last thing you want around here is to get Alex thinking about a site rename again. Well, next to last thing.

    Yeah, the last thing we want is someone talking about how things are in his home town, calling others haker schoolboys and blaming others of trying to destroy his good reputation.

  • (cs) in reply to P
    P:
    The poop of DOOM:
    GalacticCowboy:
    svn blame
    to the rescue!
    Gotta love blame! It's the sole piece in source control that keeps a team together.

    Doesn't

    svn praise
    do exactly the same thing as well? :)

    HELL no! You'd get situations where one person's gonna whine about how this guy got praise but he didn't and how that guy's praise was undeserved and whine whine bitch bitch buncha crybabies. The team'll split due to internal strife as a result. Praise is an everyone vs. everyone thing, while blame is an all vs. one thing. Major difference, that. Rule by terror, not by praise!
  • Kimberly (unregistered)

    Also known as the Mayan GOTO.

  • Tim Rowe (unregistered) in reply to Caoilte
    Caoilte:
    Would be interesting to find out how old the code is. My money is on ten.
    I bet you're right -- for some time unit.
  • Eddy (unregistered)

    Why?

    You wanna Know why?

    F*** YOU THAT'S WHY!

    Awkward code is awkward...

  • (cs)

    look like jason has talent in several software language

    PL/SQL, Java, JavaScript, Ruby.

  • Blue Leader (unregistered)

    The real WTF is allowing your mission-critical software to be written by BASIC programmers.

  • (cs) in reply to Coyne
    Coyne:
    Pim:
    m:
    No, the problem of ending calendars was solved in RFC2550 once and for all. There is no escape from the world anymore.
    Haha, that RFC was written on April the first. I'm not falling for that one! Anyway, you say there's no escaping the world, but I can try.

    \w\o\r\l\d

    There.

    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!

    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.)

  • (cs) in reply to PiisAWheeL
    PiisAWheeL:
    Coyne:
    Pim:
    m:
    No, the problem of ending calendars was solved in RFC2550 once and for all. There is no escape from the world anymore.
    Haha, that RFC was written on April the first. I'm not falling for that one! Anyway, you say there's no escaping the world, but I can try.

    \w\o\r\l\d

    There.

    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!

    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.)

    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.

  • (cs) in reply to QJo
    QJo:
    PiisAWheeL:
    Coyne:
    Pim:
    m:
    No, the problem of ending calendars was solved in RFC2550 once and for all. There is no escape from the world anymore.
    Haha, that RFC was written on April the first. I'm not falling for that one! Anyway, you say there's no escaping the world, but I can try.

    \w\o\r\l\d

    There.

    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!

    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.)

    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.

    I'm old enough to own my own house... You get off MY lawn!

  • Tom (unregistered) in reply to Melnorme
    Melnorme:
    It really does look like intentional sabotage.

    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.

  • (cs) in reply to herby
    herby:
    BentFranklin:
    The Mayans correctly predicted the end of the world in 2012, due to GOTO statements.
           GO TO 2012
    2012   CONTINUE
    
    (I couldn't resist).
    EndOfWorld:
        try
        {
         int x = 2012/0;
        }
        catch
        {
         goto EndOfWorld;
        }
    
  • Jay (unregistered)

    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 ...

  • (cs) in reply to Tom
    Tom:
    Melnorme:
    It really does look like intentional sabotage.

    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.

    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.

  • Tardis (unregistered) in reply to Anketam
    Anketam:
    World wont end in 2012, everyone knows it will end in 2038.
    No, we'll send a time traveller back to get a computer so we can fix it.
  • (cs) in reply to Tardis
    Tardis:
    Anketam:
    World wont end in 2012, everyone knows it will end in 2038.
    No, we'll send a time traveller back to get a computer so we can fix it.

    We can just add another bit and we'll be good for another 68 years.

  • J-L (unregistered)

    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.

  • (cs) in reply to J-L
    J-L:
    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.

    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.)

  • Timecube (unregistered) in reply to Tardis
    Tardis:
    Anketam:
    World wont end in 2012, everyone knows it will end in 2038.
    No, we'll send a time traveller back to get a computer so we can fix it.
    YOU ARE TOO EDUCATED STUPID TO REALISE THAT IT IS UNPOSSIBLE TO TRAVEL BACKWARDS AROUND FOUR SIMULTANEOUS ROTATING 24-HOUR DAYS!
  • your name (unregistered)

    Because... Fuck You

  • (cs)

    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.

  • (cs) in reply to Blue Leader
    Blue Leader:
    The real WTF is allowing your mission-critical software to be written in BASIC.
    FTFY
  • (cs) in reply to Tardis
    Tardis:
    Anketam:
    World wont end in 2012, everyone knows it will end in 2038.
    No, we'll send a time traveller back to get a computer so we can fix it.

    Results of Search in US Patents Collection db for: PN/20060073976: 0 patents.

    :(

  • (cs) in reply to Quicksilver
    Quicksilver:
    throw new IllegalStateException("Date not possible due to Mayan Calendar Error");

    Anyone would dare to create a Mayan Calendar class for Java? ;-)

    Somebody already started it, and it's due for release in 2012.

    Hi Akismet. How are you?

  • bob (unregistered)

    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.

  • Common Sense (unregistered) in reply to bob
    bob:
    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.

    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.

  • anonymin (unregistered)

    Fixing this should obviously have been put off until next year.

  • Common Sense (unregistered) in reply to anonymin
    anonymin:
    Fixing this should obviously have been put off until next year.
    A truly professional attitude.
  • Jay (unregistered) in reply to herby
    herby:
    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.

    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.

  • Jay (unregistered) in reply to Coyne
    Coyne:
    J-L:
    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.

    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.)

    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.

  • Anonymous Guy (unregistered)

    maybe its one of those WTF where someone had to modify the year every single year to the next year

  • Alex (unregistered)

    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!"

  • Gibbon1 (unregistered) in reply to Blue Leader
    Blue Leader:
    The real WTF is allowing your mission-critical software to be written by BASIC programmers.

    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.

  • valetudo (unregistered)

    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.

  • (cs)

    This is what happens when you outsource to Mayan subcontractors.

  • Jeff Grigg (unregistered)

    The Mayans put that line of code in there. >;->

  • Jetson (unregistered) in reply to Jay
    Jay:
    herby:
    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.

    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.

    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?

  • Jeremy Friesner (unregistered) in reply to P
    P:
    Doesn't
    svn praise
    do exactly the same thing as well? :)

    Yes, but nobody ever uses that command. :^)

  • Jeremy Friesner (unregistered) in reply to Tom

    [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!

  • Sander Demeester (unregistered)

    First of all "Happy newyear" second "GOTO?????

  • Roger (unregistered) in reply to P
    svn praise
    is for code written by me,
    svn blame
    for all other code.
  • Cathy (unregistered)

    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.

  • lol (unregistered) in reply to PiisAWheeL

    Agreed, that's what got me about it to - even if it's a codebomb, it's a bad codebomb.

  • (cs)

    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.

Leave a comment on “2012... Just Because”

Log In or post as a guest

Replying to comment #:

« Return to Article