• four@lemmy.zip
    link
    fedilink
    English
    arrow-up
    99
    ·
    2 days ago

    Senior Dev, 5 years ago, writing that code: “this is going to be a problem in a few years”

  • BartyDeCanter@lemmy.sdf.org
    link
    fedilink
    arrow-up
    30
    ·
    2 days ago

    How old was the oldest bug that you discovered that you also wrote? Mine was six years old, a null pointer dereference that worked fine on the original architecture but caused a reset when moving to Cortex-M.

    • hperrin@lemmy.ca
      link
      fedilink
      English
      arrow-up
      21
      ·
      2 days ago

      Mine was about three years old. I missed an “&” in a query constructor. The way the constructor worked, this was no issue. But that was because of another bug that assumed it was there. One day I fixed that bug. Then the query to get the user’s account didn’t have the whole “& username=“ part and now just returned the first user… admin. So everyone who logged in was admin for about twenty minutes. Had to immediately take the whole system down.

    • spongebue@lemmy.world
      link
      fedilink
      arrow-up
      9
      ·
      edit-2
      1 day ago

      If it counts, I encountered a Java file that, unbeknownst to me at the time, was duplicated across two different places. The project was essentially abandoned for years, and the file was one that didn’t change much so I left it alone for a year or so.

      Eventually I had to add a method to it. Compiled just fine, runtime threw a no such method error. Turned out Eclipse was using one, but when Maven did its build it used the old duplicate I didn’t know existed.

      Took me a while to find that one!

    • Buckshot@programming.dev
      link
      fedilink
      arrow-up
      4
      ·
      2 days ago

      Had a 3 year old one this week. A loop that builds a list of messages to send to a queue for another service to consume then it calls BatchPublish.

      Only Batch Publish was inside the loop so instead of sending n messages, it sends 1+2+3… +n

      We never noticed before because n was never more then 100 and the consuming service is idempotent so the duplicate messages don’t cause issues. I think it’s (n(n-1))/2. So n=100 is 4950. That’s only 4 minutes work. Also that code only runs at 1am.

      Recently n has been hitting 1000 which produces 499500 messages and it takes a few hours to clear and triggers an alarm for delayed processing.

    • SaharaMaleikuhm@feddit.org
      link
      fedilink
      arrow-up
      1
      ·
      2 days ago

      2 years maybe. Nothing special, just some silly mistake. I can’t even remember was it was. I make those all the time.

  • Endymion_Mallorn@kbin.melroy.org
    link
    fedilink
    arrow-up
    17
    ·
    2 days ago

    That’s better than the one “bug” I found. Obviously it was in a spreadsheet that was being touched by too many hands without any level of guidance. Problem is, it was a truly ancient error that the “end users” weren’t seeing in their fancy tables or charts. But when I looked at it, it was from when the file was converted from .123 to .xls.