• (nodebb)

    Maybe a nasty parting gift left by a disgruntled dev?

  • LXE (unregistered)

    Exactly my thought.

    And an unsophisticated one; if I were him or her, I would have scrambled it with calculations and table lookups, at least.

  • markm (unregistered) in reply to R3D3

    Or a developer inserted it to test the invalid-date branch, then forgot to remove it.

  • LCrawford (unregistered)

    How did it ever work if it assigned 2012 to YEAR every year, the result of which would be nonzero?

  • Richard Smithers (unregistered) in reply to LCrawford

    Not every language requires two equals signs when you want to test. Some use a single equal sign to indicate assignment as well as testing values. I think all the ones mentioned in the article do, but maybe there was another one in the mix that didn't. Or, it's just a typo.

  • my name is missing (unregistered)

    Now if it was 2020, then I would accept that calling it an invalid/terrible date would be justified.

  • (nodebb)

    Something was supposed to change in 2012.

  • (nodebb) in reply to Loren Pechtel

    The Aztec calendar was supposed to end in 2012, but in December.

  • (nodebb) in reply to Richard Smithers

    Not to mention Pascal, which uses := for assignment = for equality test...

  • MiserableOldGit (unregistered)

    Seems pretty trivial compared to some of the date parsing nightmares I've found in the twenty years since all the hoopla over how planes would fall out of the sky, etc. First one being Feb 2001

    I thought we were going to hear how this guarding against some brittle third party module that would assume the date was December 2020 when it saw 2012 and launch the missiles or something. .

  • Tim Ward (unregistered) in reply to markm

    That was my guess.

  • BeenHereSeenThat (unregistered)

    Amusing.
    With that deletion, you removed support for the Mayan calendar. It ended on 21 December 2012. Or so went the expectation.

  • Sigako (unregistered) in reply to LCrawford

    I think this snippet is written in pseudo-code, to avoid all irrelevant details of the language itself.

Leave a comment on “Classic WTF: 2012”

Log In or post as a guest

Replying to comment #:

« Return to Article