Hacker News new | past | comments | ask | show | jobs | submit login

> If an old package and a new package have the same import path, the new package must be backwards compatible with the old package.

Simply put, this rule is too strict, and biases modules' UX and semantics too far toward consumers.

Not all packages are so mature, and consumed by enough consumers, that they should be forced by the language tooling to maintain backwards compatibility. That requirement creates a great deal of pointless work for the majority, perhaps vast majority, of package authors, who write small and uncertain packages for use by themselves or a small number of their immediate colleagues. For these authors, strict backwards compatibility is not only unnecessary, it's actually undesirable, as it creates needless toil.

> The answer is that we learned from Dep that the general Bundler/Cargo/Dep approach includes some decisions that make software engineering more complex and more challenging.

For a minority of use cases, where packages are large and mature and imported by many, many consumers -- sure, maybe. But the vast majority of Go code, written by private organizations and used internally, doesn't fit this description.




Nothing's physically stopping you breaking backwards compatibility without using a new import path if you want to. You might piss off your users but if they don't care then go for it.


Doesn’t the go tooling mandate this if you are >= v2.0?

The rest of mod looks fine but tying paths to major version changes was a mistake IMO.


In that case, can you just stay in v0.x.y?


You can either stay in v0.x.y, or you can just always bump the major version. Either option meets Go’s versioning requirements without requiring developers to think about “is this change backwards compatible” when they tag a new release.




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

Search: