←back to thread

Hyrum's Law in Golang

(abenezer.org)
283 points thunderbong | 1 comments | | HN request time: 0.805s | source
Show context
indulona ◴[] No.42202360[source]
This is why we have semantic versioning.
replies(1): >>42203362 #
simiones ◴[] No.42203362[source]
Semantic versioning does nothing to help here. If you don't realize that people are depending on such a behavior, you won't increment the major version number.
replies(1): >>42203791 #
mseepgood ◴[] No.42203791[source]
And if you realize it (as in this case) you probably don't want to increase the major version number either, but leave it as-is (unless you follow the CADT model of maintainership).
replies(1): >>42205427 #
1. cloverich ◴[] No.42205427[source]
I think a very nice middle ground is when you decide to remove something, to mark it as deprecated in the next major version, and remove it in the one after. Not always possible, but IIRC React does this; so I'd frequently upgrade, then start seeing deprecation warning messages (in dev); I'd then have a clear signal before upgrading to the next version. It helped that major versions did not arrive often so making this kind of change was only occasionally necessary.

A bit trickier in this case no doubt; and trade offs. Ive not minded the React updates over the years, but busting out the Go code I wrote many years ago and having it still run flawlessly is amazing too.