Skip to content

Instantly share code, notes, and snippets.

@groundwater
Last active February 3, 2016 23:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groundwater/8404560 to your computer and use it in GitHub Desktop.
Save groundwater/8404560 to your computer and use it in GitHub Desktop.

I think Semantic versioning is pretty useful, but it can be a tad arbitrary deciding when a version number should increment. In a dynamic language, what exactly constitutes the public interface?

Rather than marking interfaces as stable, or unstable, choose explicit consistency guaruntees for interfaces.

Interfaces should be marked as

  1. major
  2. minor
  3. patch

Interfaces are guarunteed across version numbers of the same type. For example, an interface marked minor will not change without incrementing the minor version number.

A downstream consumer can even lock the version depending on what interfaces they are consuming. If you're using the major and minor interfaces of version 1.2.12 choose ~1.2.12. If you're only consuming the major interfaces choose ~1.2.

Discussion

Any change must increment the version in some way, even by adding a fourth tag. Adding an interface can increment any version number, but which number you increment is a judgement call.

For example, if you add a whole new major API, you may just want to increment the major version number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment