• tunetardis@lemmy.ca
    link
    fedilink
    arrow-up
    12
    ·
    7 months ago

    Falsehoods About Time

    Having a background in astronomy, I knew going into programming that time would be an absolute bitch.

    Most recently, I thought I could code a script that could project when Easter would land every year to mark it on office timesheets. After spending an embarrassing amount of…er…time on it, I gave up and downloaded a table of pre-calculated dates. I suppose at some point, assuming the code survives that long, it will have a Y2K-style moment, but I didn’t trust my own algorithm over the table. I do think it is healthy, if not essential, to not trust your own code.

    Falsehoods About Text

    I’d like to add “Splitting at code-point boundary is safe” to your list. Man, was I ever naive!

    • SatouKazuma@ani.social
      link
      fedilink
      arrow-up
      5
      ·
      7 months ago

      Rocket programmer (and engineer) here. Can confirm that time programming is hell. Don’t even start on DST.

    • NotMyOldRedditName@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      7 months ago

      I’m sure many smaller companies had their own internal Y2K moment as they scaled and became a big hit, and realized they used a wrong datatype like int instead of long or something and shit was gonna break by XYZ date if they did nothing heh.