2012... Just Because

« Return to Article
  • First 2012-01-02 09:04
    Frist

    Happy new year!
  • Null 2012-01-02 09:05
    First (of January)!
  • PiisAWheeL 2012-01-02 09:07
    Code Bomb?

    Null:
    First (of January)!


    And its the Second.
  • Raizer 2012-01-02 09:11
    Did the mayans put this code?
  • Petr 2012-01-02 09:12
    The "World will end anyway" preparations?
  • Suomynona 2012-01-02 09:12
    Should be 2013, as we all know it wont happen, just to be sure that no one can renew the license after the apocalypse.
  • iluxa 2012-01-02 09:13
    I think someone was just too fond of the end of the world idea
  • PiisAWheeL 2012-01-02 09:15
    iluxa:
    I think someone was just too fond of the end of the world idea


    That doesn't excuse the fact that they missed by about 11 (and some change) months.
  • Poster 2012-01-02 09:18
    You need that kind of statement to test the error case.
    Of course you're supposed to remove it after testing the error case...
  • Melnorme 2012-01-02 09:26
    It really does look like intentional sabotage.
  • Pim 2012-01-02 09:32
    And of course, as we all know the world will end after December 31, 9999. After all, that's when the calender ends.
  • GalacticCowboy 2012-01-02 09:37
    svn blame
    to the rescue!
  • d 2012-01-02 09:37
    You took out the anti end of the world code!!! WHAT HAVE YOU DONE!!?!
  • The poop of DOOM 2012-01-02 09:40
    GalacticCowboy:
    svn blame
    to the rescue!

    Gotta love blame! It's the sole piece in source control that keeps a team together.
  • m 2012-01-02 09:42
    Pim:
    And of course, as we all know the world will end after December 31, 9999. After all, that's when the calender ends.

    No, the problem of ending calendars was solved in RFC2550 once and for all. There is no escape from the world anymore.
  • Pim 2012-01-02 10:00
    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.
  • notromda 2012-01-02 10:02
    GalacticCowboy:
    svn blame
    to the rescue!


    Sadness is when you run that and you can only blame yourself. It's a double edged sword. :D
  • FRooP 2012-01-02 10:07
    Maybe the IF should have been left in and changed to 2127 ... and I thought a part of the Y2K work was to centralise century windows, certainly not have them coded in-line in various modules ...
  • Caoilte 2012-01-02 10:14
    It's still stupid, but perhaps it was put in for testing.

    Would be interesting to find out how old the code is. My money is on ten.
  • Not Frist 2012-01-02 10:22
    We had a radar simulation that crashed when a swerling number other that 4 was entered with a message saying..."Major error, Bye.'. After some digging, we hit your situation. Go figure.
  • Adrian Wood 2012-01-02 10:23
    I would suggest it was perhaps put in long ago when there as no way any client could possibly be claiming a valid licence as far ahead as 2012, meaning anything with that year has to be invalid... except then, why would the code not test for any years AFTER then as well?

    Still a fail regardless, of course!
  • simonbuchan 2012-01-02 10:37
    There is, (of course) a real 2012 overflow: the DOS date format, which is still the "blessed" timestamp format in Zip files. NTFS and Unix format timestamps are fairly widely supported as well (though as extensions), but I'm expecting some nasty bugs to get flushed out over the year in various hand-written zip creator/readers (and you *know* there is a bunch of those!)
  • Gary Olson 2012-01-02 11:18
    Melnorme:
    It really does look like intentional sabotage.


    Looks like employment preservation code.
  • P 2012-01-02 11:31
    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? :)
  • DaveK 2012-01-02 11:49
    simonbuchan:
    There is, (of course) a real 2012 overflow: the DOS date format, which is still the "blessed" timestamp format in Zip files.
    It may be the blessed timestamp format, but it doesn't roll over until 2107, as it has 7 bits for year number from 1980.

  • ekolis 2012-01-02 11:57
    You took out the anti end of the world code!!! WHAT HAVE YOU DONE!!?!


    Dawn of The Second Day

    48 Hours Remain...
  • DaveK 2012-01-02 12:29
    ekolis:
    You took out the anti end of the world code!!! WHAT HAVE YOU DONE!!?!


    Dawn of The Second Day

    48 Hours Remain...
    Jack Bauer would have already finished the game by now!

  • Zecc 2012-01-02 12:31
    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.
    \⊕ or perhaps 🌐
  • foo 2012-01-02 12:33
    PiisAWheeL:
    iluxa:
    I think someone was just too fond of the end of the world idea


    That doesn't excuse the fact that they missed by about 11 (and some change) months.
    People should spend the last 11 months of the world contemplating their lives instead of dealing with crappy software licenses.
  • TRTDWTF 2012-01-02 12:37

    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.
  • BushIdo 2012-01-02 13:50
    Is there really a more effective way to stare into the abyss of human existence than dealing with crappy software?
  • some guy 2012-01-02 13:55
    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.
  • will 2012-01-02 16:33
    Do need for sabotage, there is an INVALIDDATE section and this was probably a test for that. Someone did not remove a debugging statement.
  • Omnifarious 2012-01-02 16:44
    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.
  • F 2012-01-02 17:44
    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.
  • Max 2012-01-02 17:45
    By removing the statement you have awoken Ctulhu
  • Quicksilver 2012-01-02 18:05
    throw new IllegalStateException("Date not possible due to Mayan Calendar Error");


    Anyone would dare to create a Mayan Calendar class for Java? ;-)
  • a 'oi rgb 2012-01-02 18:20
    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.
    Because someone who runs a free site is not entitled to a holiday over Christmas/New Year?
  • BentFranklin 2012-01-02 18:31
    The Mayans correctly predicted the end of the world in 2012, due to GOTO statements.

  • Atle 2012-01-02 18:36
    TRWTF is not grep'ing for invalid and date in the same line.
  • Zekses 2012-01-02 18:53
    Should've been 2013. There'd be no one to care :)
  • steve goodhall 2012-01-02 19:10
    "Go to"!?
  • herby 2012-01-02 20:10
    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).
  • Totara 2012-01-02 20:21
    That was planned by your workmates so you would miss the office NYE party. They probably injected this a week ago in your back cos they didn't wanna see you at the party.
  • 8bit 2012-01-02 21:20
    Seriously?

    You need that kind of statement to test the error case.


    Wouldn't a real invalid date be better? 1854 or something. Otherwise what are you testing?


    Of course you're supposed to remove it after testing the error case...


    Oh oh so the real wtf is you tested code that no longer exists, was wrong to begin with, without an automated unit test,and the whole process is totally unreproducible.



  • Anketam 2012-01-02 21:50
    World wont end in 2012, everyone knows it will end in 2038.
  • da Doctah 2012-01-02 21:54
    It took me a moment to realize the significance of 4:00PM, but then it hit me: I'm on Pacific Time, which is UTC -8 hours.


    I had one of those blinding-flash-of-light moments back in the 90s. Our stand-in transaction processing system suddenly threw out a whole mess of "invalid currency" errors one July. Nothing we hadn't seen before, but the quantity of them hit an all-time one-day spike. When I was finally able to get the dumps, it turned out they were all coming from the same third-party channel (a consolidator for traffic from airlines), and all the invalid currencies were Canadian dollars (at that time the stand-in system could only handle US dollars, and we limited the channels based on whether we expected them to use anything else).

    Suddenly it hit me. The first of July. Canada Day. Canucks all over the world who would otherwise never charge anything on their credit cards were suddenly flying back home on the same day. On Air Canada. And charging the tickets in loonies.
  • syockit 2012-01-02 22:04
    The good thing is, it forces the maintainer to recheck the whole codebase
  • lolwtf 2012-01-02 22:04
    8bit:
    You need that kind of statement to test the error case.


    Wouldn't a real invalid date be better? 1854 or something. Otherwise what are you testing?
    Go ahead and set your system clock to the year 1854 and let me know how it turns out.
  • Coyne 2012-01-02 22:10
    FRooP:
    Maybe the IF should have been left in and changed to 2127 ... and I thought a part of the Y2K work was to centralise century windows, certainly not have them coded in-line in various modules ...


    Nah. This defers the problem too long. He should have put in 2013...job security, you know. If he still works there, he can fix it December 30th to avoid the New Year's disruption.

    If he doesn't, well, someone else can put it off for another year, right?
  • Coyne 2012-01-02 22:12
    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


  • Coyne 2012-01-02 22:14
    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 2012-01-02 22:17
    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 2012-01-02 22:38
    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 2012-01-03 03:22
    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.
  • The poop of DOOM 2012-01-03 03:49
    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...)
  • The poop of DOOM 2012-01-03 03:50
    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.
  • The poop of DOOM 2012-01-03 03:52
    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 2012-01-03 05:01
    Also known as the Mayan GOTO.
  • Tim Rowe 2012-01-03 06:48
    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 2012-01-03 07:17
    Why?

    You wanna Know why?

    F*** YOU THAT'S WHY!

    Awkward code is awkward...
  • Nagesh 2012-01-03 09:03
    look like jason has talent in several software language

    PL/SQL, Java, JavaScript, Ruby.

  • Blue Leader 2012-01-03 09:25
    The real WTF is allowing your mission-critical software to be written by BASIC programmers.
  • PiisAWheeL 2012-01-03 10:39
    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.)
  • QJo 2012-01-03 10:42
    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.
  • PiisAWheeL 2012-01-03 12:26
    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 2012-01-03 12:29
    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.
  • galgorah 2012-01-03 13:17
    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 2012-01-03 13:42
    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 ...
  • PiisAWheeL 2012-01-03 13:55
    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 2012-01-03 14:13
    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.
  • PiisAWheeL 2012-01-03 14:23
    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 2012-01-03 14:23
    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.
  • Coyne 2012-01-03 14:59
    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 2012-01-03 15:40
    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 2012-01-03 16:01
    Because... Fuck You
  • herby 2012-01-03 17:55
    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.
  • Watson 2012-01-03 19:56
    Blue Leader:
    The real WTF is allowing your mission-critical software to be written in BASIC.

    FTFY
  • Watson 2012-01-03 19:59
    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.

    :(
  • random_garbage 2012-01-04 00:06
    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 2012-01-04 04:28
    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 2012-01-04 05:48
    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 2012-01-04 05:49
    Fixing this should obviously have been put off until next year.
  • Common Sense 2012-01-04 07:23
    anonymin:
    Fixing this should obviously have been put off until next year.

    A truly professional attitude.
  • Jay 2012-01-04 14:19
    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 2012-01-04 14:22
    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 2012-01-04 16:02
    maybe its one of those WTF where someone had to modify the year every single year to the next year
  • Alex 2012-01-04 16:04
    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 2012-01-04 16:14
    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 2012-01-04 16:26
    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.
  • Arancaytar 2012-01-05 02:52
    This is what happens when you outsource to Mayan subcontractors.
  • Jeff Grigg 2012-01-05 19:38
    The Mayans put that line of code in there. >;->
  • Jetson 2012-01-06 08:15
    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 2012-01-07 02:54
    P:
    Doesn't
    svn praise
    do exactly the same thing as well? :)


    Yes, but nobody ever uses that command. :^)
  • Jeremy Friesner 2012-01-07 03:00
    [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 2012-01-07 07:31
    First of all "Happy newyear" second "GOTO?????
  • Roger 2012-01-09 06:49
    svn praise
    is for code written by me,
    svn blame
    for all other code.
  • Cathy 2012-01-12 23:10
    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 2012-03-17 21:59
    Agreed, that's what got me about it to - even if it's a codebomb, it's a bad codebomb.
  • tgape 2012-04-03 19:57
    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.