Skip Navigation

Is it really a breaking change if a method changes output after an update?

This might seem obviously "yes" at first, but consider a method like foo.debugRepr() which outputs the string FOO and has documentation which says it is meant only to be used for logging / debugging. Then you make a new release of your library and want to update the debug representation to be **FOO**.

Based on the semantics of debugRepr() I would argue that this is NOT a breaking change even though it is returning a different value, because it should only affect logging. However, if someone relies on this and uses it the wrong way, it will break their code.

What do you think? Is this a breaking change or not?

23 comments
  • Only if it's specified and documented as part of a contract with the user. If they're relying on internal implementation details, well that's a good lesson for them not too do that.

  • It's your project, do whatever you want.

    If changing any observable behavior meant a breaking change, then you couldn't ever change anything. Even a bug fix changes observable behavior. Some people don't seem to be considering that here...

  • If I don't break the contract and your code breaks that's your problem imo

  • My tests that observe output from the method are failing so it's a breaking change. Did you not test the printed output?

23 comments