46

5 years ago, in my first week of starting this particular job, the CTO casually mentioned they'd been struggling with a bug for years. Basically, in the last few days of the year, it seemed that records were jumping a year ahead, with no rhyme nor reason why. Happened every year, and wasn't linked with them deploying new code. (Their code was a mess with no sane way to unit test it, but that was a separate issue.)

I happened to know immediately what might be causing it - so I ran a case-sensitive search in the codebase for "YYYY", pointed out the issue, explained it, then committed a fix all in about 2 minutes.

I was told I'd officially passed my probation.

(Search for "week year vs year" if you're curious & the above doesn't ring any bells.)

Comments
  • 5
    BS. 😂.

    This only comes with experience cuz' the bug would be hard to even google (probably 🤔).

    Well done 🙌
  • 6
    @mentions

    From my experience, if you've touched the world of ISO 8601 and actually tried to understand it, you'll know this.

    And you'll know that many many many many many many many many many devs seem to never have read it, as there are countless wrong implementations. :)

    The worst are self made time functions... Like counting weeks in a year, and limiting to 52 (53 is possible). Or determination of the calendar week without taking account of the several rules when the first week in a year starts...

    It's sad... :(
  • 0
    Super. It was interesting
  • 2
    I've been using the ISO 8601 format for couple of years, but didn't know about this. I've always used "yyyy" myself. I guess I'm fortunate that my colleagues also used the same.

    If I had faced the issue, I would've been stumped. Good thing you shared.

    1 thing I learned today.
  • 0
    I liked it too
  • 0
    maybe you are right
Add Comment