This will be part of my talk at YAPC.

I recommend you use 2.xxx, where xxx is always zero-padded.

    our $VERSION = '2.001'; # 2nd version of revision 2
    our $VERSION = '2.420'; # 421st version of revision 2

It has the following properties:

* It is fully compatible with the advice in
    * perlmodstyle
    * version.pm
    * "strict" version rules
  <http://p3rl.org/perl5120delta#Version-number-formats>
    * <http://www.dagolden.com/index.php/369/> ¹
    * Perl::Critic::Policy::ValuesAndExpressions::ProhibitVersionStrings
    * Perl::Critic::Policy::ValuesAndExpressions::RequireNumericVersion
* It completely prevents:
    * trailing zeros from disappearing because it's a quoted string
    * the confusion about 1.10 < 1.9 (Perl says that's true, other
  system say the opposite) because there are always exactly 3 digits
  after the decimal mark, so any(numeric,lexicographical,naturalsort)
  comparison has the same result
    * the confusion about 5.10.1 == 5.010001 (and the variant mentioned
  by Aldo) since there is only a single representation because there
  are only enough decimal places (namely 3) for one portion of semver
  (or Perl's notion thereof)
    * the confusion around v-strings which after all those years still
  are such an usual and (on average) poorly understood data type
    * that ugly v-prefix in the distro package name
* It is fully compatible with downstream packaging toolchains (RPM
  specfile macros and the like).
* It is incompatible with semver. Not a big loss, for the reasons
  already mentioned by David.

¹ Avoid underscore version numbers and you don't need that ugly `eval`.
Simply use the `TRIAL` feature for trial releases instead.
<https://pause.perl.org/pause/query?ACTION=pause_04about#convention

Attachment: signature.asc
Description: PGP signature

Reply via email to