• (nodebb)

    It should not have been quietly corrected...that is "Drive-by coding" and a source of many problems.... However it should have been noted in the tracking system as a defect/bug so that it could have been prioritized as appropriate...Of course this defect/bug would include a test (not part of the live suite) that demonstrated the bug, and would subsequently pass when the appropriate change was made.

  • 🤷 (unregistered) in reply to TheCPUWizard

    Bold of you to assume they used some sort of tracking system.

  • (nodebb) in reply to 🤷

    Bold of him to assume the dev had clearance to write test cases.

  • MiserableOldGit (unregistered)

    TRWTF is that version numbering system, it's an accident waiting to happen with RegEx or string manipulation. Pretty much guaranteed with that dumb-ass string slicing.

  • Mattikus (unregistered) in reply to MiserableOldGit

    Stupid question - as a non-developer (sysadmin by trade), what would be best solution to this problem (without changing version numbers)? My first thought would be look for a full stop / decimal point and take the string to the left of it. Then try and parse the string as an integer and compare against that...

    But it seems a bit convoluted and not an “pretty” solution

  • Prime Mover (unregistered) in reply to Mattikus

    No-brainer. Split the version string into two, indexed by the dot. So the first bit is trivially an integer: 9, 10, 11, 12, ... and the second bit is the version string which needs to be handled however that works.

  • Prime Mover (unregistered)

    TRWTF is of course the boss who won't listen when one of his staff announces there's a problem.

  • Ash (unregistered)

    Of course if this code still existed, it would take minutes to create a single generic method with correct logic and make the existing methods delegate to it passing the major version or year as a parameter.

  • Wtf (unregistered)

    Just use semver, jesus

  • Some Ed (unregistered) in reply to Prime Mover

    I count four parts.

    Before the . numeric after the dot alphabetic after the alphabetic.

    Compare each in order, only progressing to the later sets in cases of equality in the former sets.

    I would use a regex to split it into those parts, but it would be OK, because I understand regular expressions, and I know to document all of my regular expressions in excruciating detail for those who don't.

  • James Quarret (unregistered)
    Comment held for moderation.

Leave a comment on “Best of 2020: The Time-Delay Footgun”

Log In or post as a guest

Replying to comment #520891:

« Return to Article