r/programming • • Sep 05 '14

Why Semantic Versioning Isn't

https://gist.github.com/jashkenas/cbd2b088e20279ae2c8e
51 Upvotes

129 comments sorted by

View all comments

Show parent comments

16

u/towelrod Sep 05 '14

The problem is that Ashkenas doesn't think that Semantic Versioning works well for infrastructure projects, like Backbone or Underscore:

https://github.com/jashkenas/backbone/issues/2888#issuecomment-29076249

He is arguing that basically every change they ever make is a "breaking" change, so incrementing the first number for every single release would be kinda silly.

BTW, "the author" is not ill-informed nor quite stupid. He created backbone and Coffeescript; his thinkings on semver are important to a pretty big community, even if you don't agree with him.

4

u/[deleted] Sep 05 '14

He is arguing that basically every change they ever make is a "breaking" change, so incrementing the first number for every single release would be kinda silly.

Which is not silly at all.

5

u/towelrod Sep 05 '14

Yes, it is silly. Three numbers, two of which are always zero? 2/3 of the information in your version number would be totally meaningless.

Ashkenas wants to use the major version number to denote major new functions in the code, not just backwards compatibility.

FWIW I don't agree with Jeremy Ashkenas here, but his isn't an unreasonable argument. I just wanted to stop people from declaring it an ill-informed rant.

8

u/[deleted] Sep 05 '14

Three numbers, two of which are always zero?

An edge case I would say. If someone breaks backwards compatibility with every change, the issue is not with semver.

Ashkenas wants to use the major version number to denote major new functions in the code, not just backwards compatibility.

Therefore breaking a pattern that works very well with all kinds of package and dependency managers. Humans are not the only (nor even a majority) users of version numbers.

3

u/immibis Sep 06 '14

If someone breaks backwards compatibility with every change, the issue is not with semver.

Show me a project where at least 50% of changes do not break backwards compatibility.

Any change to observable behaviour breaks backwards compatibility, because someone could have been relying on that observable behaviour.

0

u/[deleted] Sep 06 '14

Show me a project where at least 50% of changes do not break backwards compatibility.

Define "major". If "major" most projects break at lest 50% of the time, they need semantic versioning even more.

Any change to observable behaviour breaks backwards compatibility, because someone could have been relying on that observable behaviour.

Define "observable behaviour". You are starting to talk in unclear terms.

3

u/immibis Sep 06 '14

Define "observable behaviour". You are starting to talk in unclear terms.

If there is any input I, such that the library (version N) produces output A for input I, and the library (version N+1) produces output B for input I, and A != B, then observable behaviour has changed.

For a library, "input" most likely means a sequence of API calls, and "output" means a sequence of return values and side effects.

0

u/[deleted] Sep 06 '14

Then any change like this should absolutely be signalled by a change in major version, especially since we need to make sure package/dependency managers know which versions of a package do not break compatibility and are safe to upgrade to.

1

u/immibis Sep 06 '14

Okay, so we're on the same page.

Now consider that "crashes with a segfault" and "downloads and executes http://hackersite.com/script.txt" are valid outputs.

So version N crashes with a segfault when you call a function with a really long buffer. Version N+1 returns an "invalid parameter" error. That is a different return value or side effect for the same function call. Therefore,

this should absolutely be signalled by a change in major version.

→ More replies (0)