Hacker News new | ask | show | jobs
by ziml77 1337 days ago
Meanwhile I've had to make changes to hand-rolled version comparison code in multiple systems because the original developers didn't account for the second segment of the version being greater than 9.

I'm absolutely not saying that you should have used a library, but pointing out the other side of the problem. If they had used an existing library to handle the versions, it wouldn't have had this issue. And test cases wouldn't help here because if they didn't think to code for multiple digits in the second spot, they likely wouldn't have thought to test for it.

There's enough benefits and drawbacks to library vs roll-your-own that I don't rigidly stick to one way or the other.

1 comments

Or, you would have the same issue and the library developer wouldn't have time/care to fix it...

Also good sweng practices would dictate to put it in one function that is used in all places so you only need to fix it once.