democritus-project / roadmap

The roadmap for the democritus project (for tracking ideas, projects, etc).
0 stars 0 forks source link

CalVer vs. SemVer #46

Closed fhightower closed 3 years ago

fhightower commented 3 years ago

I would like to consider (and articulate why) democritus project will use one versioning system over the other.

fhightower commented 3 years ago

A few thoughts:

It seems:

fhightower commented 3 years ago

TL;DR

⚠️ UPDATE - MARCH 2021: This is an old comment and the details no longer apply; see subsequent comments for more details. ⚠️

The democritus project will use a variation of calver that includes a major version to communicate breaking changes. It will take the form: MAJOR.YYYY.0M.0D. If there are multiple releases on the same day, the form will be: MAJOR.YYYY.0M.0D.MINOR.

General Thoughts

I believe the goal of versioning software is so that humans and machines can differentiate versions of software. Thus, a versioning system's effectiveness should be measured by its ability to communicate what is different between versions of software.

Thoughts on SemVer

Thoughts on CalVer

Versioning in Democritus

After some consideration, packages in the Democritus project will be versioned like:

MAJOR.YYYY.0M.0D

(using the terminology described here)

If there are multiple releases on one day, the version will be:

MAJOR.YYYY.0M.0D.MINOR

A bump of the major version communicates that the authors intend a breaking change (e.g. there is a breaking change between 1.2021.01.13 and 2.2021.01.14)

Versions starting with 0. shall be considered in development (as in SemVer) and may change at any time without incrementing the MAJOR version.

Sources

Inspirations for our versioning scheme:

Validation

I have validated this scheme using the packaging library:

from packaging.version import parse

version = '1.2020.01.13'
parse(version)
fhightower commented 3 years ago

⚠️ UPDATE ⚠️

The versioning scheme described in the previous comment has changed and the Democritus Project will use Semantic Versioning.

Why SemVer?

Short Answer

There are four reasons:

  1. No/few good reasons not to use it
  2. SemVer meaningfully and effectively communicates what is important (the intended scope of a change)
  3. SemVer is established and widely used/understood
  4. It is easy to move from SemVer to another versioning scheme (like MAJOR.YYYY.0M.0D which was originally chosen for this project)

Long Answer

There is a recent movement against Semantic Versioning (semver) and I sympathize with some of the points raised against semver. That being said, most of the objections to semver I have read are not really objections to semver, but objections to:

Hence, I am aware of very few, substantive reasons why I would use something other than semver. Additionally, I think Semantic Versioning is effective as it provides a meaningful and reasonable way to communicate changes (or at least intentions) across versions. Many calendar versioning schemes give up on the endeavour of communicating intentions entirely which is, I believe, unwise. If I am comparing version 2018.01.01 with 2018.02.01, I know nothing other than the fact that those two versions are one month apart. Using SemVer (even with some legitimate ambiguities around what constitutes a breaking vs. non-breaking change), at least gives me the chance to estimate the scope of the change. Thus, I believe the, albeit imperfect, communication of intentions is more valuable than giving up on the endeavour entirely.

In addition, there are two other reasons we are using semver. First, it is a well established and understood standard that is widely used (and it is a good practice to use standards, when possible and reasonable). Second, it is easy to switch from semantic versioning to a different versioning scheme, like the one detailed in previous comments, if semver is not working.

Future Changes?

If we do change at any point in the future, we will likely be changing to the CalVer scheme: MAJOR.YYYY.0M.0D or FerVer (like semantic versioning, but allows "minor" breaking changes to be shipped with a minor version bump).