Article 4T56M Why I don’t start versions at 0.x any more

Why I don’t start versions at 0.x any more

by
jonskeet
from Jon Skeet's coding blog on (#4T56M)

(I'm writing this post primarily so I can link to it in an internal document on Monday. There's nothing sensitive or confidential here, so I might as well get it down in a blog post.)

SemVer is pretty clear about pre-releases. Any version with a major version of 0 is considered initial development", and anything can change at any time. Pre-releases - versions which have a hyphen after the regular version number - are also considered unstable.

In any project, I used to use 0.x to start with and then progress to 1.0.0-alpha01 or similar1 at some point. I've stopped doing this now.

For any project I start now, the first release will be 1.0.0-alpha01 or 1.0.0-beta01. The reason? Consistency. With this scheme, never releasing anything with starting with 0." there's a very consistent story about what the pre-releases for any given version are: they're that version, with a hyphen after it. So for example:

  • The pre-releases for 1.0.0 are 1.0.0-alpha01, 1.0.0-alpha02, 1.0.0-beta01 etc
  • The pre-releases for 1.1.0 are 1.1.0-alpha01, 1.1.0-alpha02, 1.1.0-beta01 etc
  • The pre-releases for 2.0.0 are 2.0.0-alpha01, 2.0.0-alpha02, 2.0.0-beta01 etc

All very consistent. Whereas if you use a major version of 0 as well, just version 1.0.0 is treated specially. It gets pre-releases of 0.1, 0.2, 1.0.0-alpha01, 1.0.0-alpha02, 1.0.0-beta01 etc. I'm fine with things being inconsistent when there's a good reason for it, but I don't see any benefit here.

While you might argue the case for a difference between initial development" and first alpha release" I suspect that's almost never really useful. It's hard enough working out exactly when to move from alpha to beta (and documenting the reasons for that decision), without having a pre-alpha" stage to consider.

This isn't something I feel strongly enough to put effort into persuading the world - I'm not on an anti-0.x crusade - but if this post happens to have that effect, I'm not going to complain :)

1 SemVer would actually suggest using 1.0.0-alpha.1 instead of 1.0.0-alpha01. Dot-separated identifiers are compared for precedence, and identifiers which are only numeric are compared numerically. So 1.0.0-alpha.11 comes after 1.0.0-alpha.2, which is good. However, using 1.0.0-alpha02 and 1.0.0-alpha11 gives the same effect, without having to worry about anything that uses lexicographic ordering. There's still a problem when you reach version 1.11.0 version 1.2.0 of course. My point is that this post documents what I currently do, but you may well wish to have a different flavour of prerelease.

External Content
Source RSS or Atom Feed
Feed Location http://codeblog.jonskeet.uk/feed/
Feed Title Jon Skeet's coding blog
Feed Link https://codeblog.jonskeet.uk/
Reply 0 comments