- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
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.
Admin
Bold of you to assume they used some sort of tracking system.
Admin
Bold of him to assume the dev had clearance to write test cases.
Admin
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.
Admin
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
Admin
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.
Admin
TRWTF is of course the boss who won't listen when one of his staff announces there's a problem.
Admin
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.
Admin
Just use semver, jesus
Admin
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.
Admin
They are using a tracking system, Really?