Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Agreed - and just to drive home a point you touched on: the foundation of SemVer is an arbitrarily defined 'public API'.

Imagine a project which consists of a library, a CLI tool, and perhaps a GUI.

* Is the library API part of the public API? That's for you to decide according to SemVer.

* Is removing/renaming a CLI flag a breaking change? Also for you to decide.

* Is removing major functionality from the GUI a breaking change?

..you get the picture. Every project defines 'their public API' for themselves.

This isn't a made-up example, many projects have a library and a CLI, with one considered to be 'the main project' while the other is something most people are not expected to use.

Heck, even following SemVer to the exact letter often doesn't communicate information how people expect. For example, say your library exposes a piece of metadata from the underlying OS: a function returning a `string`. But in Windows 10 -> Windows 11, they changed the API to return an `[]string` instead of a single `string`. If you want your software to run on Windows 11, you have no choice but to change your public API in a breaking, non-backwards-compatible way.

Cool, no problem, according to SemVer we bump our public API version from v1.0 to v2.0 now, right? But wait! 99% of our users do not even make use of this one-off weird function! In fact, we think we could remove it without anyone complaining but it's technically part of our public API..

SemVer has no way to express 'we had to make a breaking change that doesn't affect 99% of users', it just has a way to express 'breaking change'. If you follow SemVer, then that means your project needs to go from v1.0 -> v2.0 in that case, yes - and now you get to explain to your users why v1.0 -> v2.0 is not, in fact, a 'major change' despite it being defined as such semantically.

What most people think of as SemVer, in practice, is often _romantic versioning_ or _sentimental versioning_ and not _semantic versioning_.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: