http://www.perlmonks.org?node_id=780301


in reply to module version numbers

I think if the only goal is to reduce misinterpretations or incompatabilities, you should use version numbers without digits. Just counting from 1 (or 0) will do. Some people use YYYYMMDDhhmm. DNS uses YYYYMMDDXX, with XX starting at 01 and incrementing to 99 for updates happening the same day.

The reason is that Perl considers '1.2' a newer version than '1.19' - '1.2' being a shorthand for '1.200', and '1.19' a shorthand for '1.190'. And that's fine when all you have to care about is Perl and its common infrastructure. But if you interact with tools or people that aren't focussed on Perl, you may encounter tools or people who consider '1.2' an older version than '1.19'.

I'm not claiming one system is better than the other. (Although considering '1.2' newer than '1.19', but '1.19.0' to be newer than '1.2.0' is something I find confusing). Just that eliminating dots has its benefits.

Of course, that way you lose the convention that the more dots after the incremented number changes, the bigger the change is. But I've seen small projects using version numbers like 1.2.3.4 which makes me wonder what kind of change bumps the version to 1.2.3.5 and what kind of change bumps it to 1.2.4.0. Or 1.3.0.0.

Replies are listed 'Best First'.
Re^2: module version numbers
by ig (Vicar) on Jul 15, 2009 at 14:07 UTC

    I assume you mean numbers without dots rather than without digits.

    I like the DNS convention and have used it elsewhere, but would miss the major/minor distinction for a module. I may not be good at it, but I like the idea of the major version number changing as the committed interface changes, or when incompatibilities are introduced. An API version number could be added as a prefix, maybe with an underbar for visual distinction. Perhaps something like: 'MM_YYYYMMDDXX'

    Yet, floating point numbers with only a couple of digits after the decimal point seems to be the most common, among the few modules I have looked at. I'm more of a sheep than a wolf, nervous about doing something unconventional which may become an unfortunate edge case some day.

    As an alternative to multiple dots in the extended version numbers, I have the impression that there is some special handling to preserve an underbar in the fractional part of a floating point version (e.g. "1.02_03"), but maybe this is only in version, and I don't understand why the example isn't "1.002_003".

    Not that I'm pinning any of this on you - I appreciate your comments.