Skip to content

Problems with the Magic Zero #221

@isaacs

Description

@isaacs

The "anything may change at any time" nature of a leading zero major version is somewhat disruptive for authors who may feel intimidated at the perceived commitment involved in a 1.0.0 release.

We may all have see The Light, and realized that the number 1 is in fact a perfectly fine place to start counting our releases, and casually increment the major version with every breaking change if that change provides some value. But many are timid, and talking them out of their timidity is very difficult.

Yet, the language in section 4 makes it very difficult to rely on pre-1.0 code. I believe that this increases, rather than decreases, the trepidation at marking something 1.0. It would be better with a slight increase in commitment; a stepping stone from the wild world of 0.0.4 up to the public scrutiny of 1.2.3.

This would also allow project authors to communicate non-breaking additive changes in the 0.x.y version families. In practice, many seem to treat the transition from 0.9.2 to 0.9.3 as a non-breaking change, whereas they'd treat 0.9.2 to 0.10.0 as potentially introducing breaking changes. (Node, for example, operates this way, though that is a pretty egregious example of Sentimental Versioning.)

In effect, the left-most non-zero version number is the "effective major version", and incrementing it indicates a breaking change. The next place is the "effective minor version", and the third is the "effective patch version". This allows authors to more gradually shift from "anything goes" to "grownup".

The ^ operator in https://github.com/isaacs/node-semver used to operate this way, until some users requested that it instead follow the SemVer specification. However, shifting to ^0.x.y meaning "exactly equal to 0.x.y" has proven very problematic in practice.

I haven't wordsmithed this very much, but this is a first-pass at some language we could use to express this. If others on this repo feel it's worthwhile, I'd be happy to send a proper pull request.

diff --git a/semver.md b/semver.md
index 0c060db..8dfdc06 100644
--- a/semver.md
+++ b/semver.md
@@ -68,8 +68,14 @@ Each element MUST increase numerically. For instance: 1.9.0 -> 1.10.0 -> 1.11.0.
 1. Once a versioned package has been released, the contents of that version
 MUST NOT be modified. Any modifications MUST be released as a new version.

-1. Major version zero (0.y.z) is for initial development. Anything may change
-at any time. The public API should not be considered stable.
+1. Major version zero and minor version zero (0.0.z) is for initial
+development. Anything may change at any time. The public API should
+not be considered stable.
+
+1. Major version zero and minor version greater than zero (0.y.z) is
+for beta development. Additive changes may be introduced by
+incrementing the patch version. Breaking changes may be introduced by
+incrementing the minor version.

 1. Version 1.0.0 defines the public API. The way in which the version number
 is incremented after this release is dependent on this public API and how it

cc @haacked @mojombo @othiym23 @domenic @ceejbot

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions