A while back I was developing a workflow scheduler. However the run duration kept coming back negative. The runs kept finishing like 15 seconds before they started. Eventually I figured out why; the company had configured a policy to use their custom NTP server, but it was 16.7 seconds off. So my Windows laptop's time was in the future, but the WSL VM (which ran the program) used another NTP server and was correct. In the end I just added a bodge that made the program request the time from an external server on startup to calculate an offset.

you are viewing a single comment's thread
view the rest of the comments
[–] 15 points 22 hours ago (4 children)

Person before flipped a bunch of if checks to put the value before the variable (if 6==x rather then if x==6). They messed up a bunch of the <= and >= checks by forgetting to reverse them. I improved performance and fixed numerous bugs by tracking those down.

  • source
  • hideshow 4 child comments
  • [–] 9 points 20 hours ago* (3 children)

    Ah yes, yoda conditionals. Because guarding against accidentally typoing if(x=6) is worth destroying your code's readability.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 6 points 14 hours ago* (last edited 10 hours ago) (2 children)

    This is not needed anymore thanks to compiler warnings

  • source
  • parent
  • hideshow 2 child comments