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?

  • kevincox@lemmy.ml
    link
    fedilink
    arrow-up
    38
    arrow-down
    1
    ·
    1 year ago

    This is https://www.hyrumslaw.com/.

    Basically there are two types of breaking changes:

    1. The change may break something.
    2. The change breaks a contract of the code.

    What you are experiencing with debugRepr() is that you have triggered 1. You have made a chance that may break a user. But you have not triggered 2 because the new output is still within the previous contract. What level of stability you want to uphold is up to you.

    • VoterFrog@lemmy.world
      link
      fedilink
      arrow-up
      2
      ·
      edit-2
      1 year ago

      Which one is important is going to depend on the context for sure.

      If it’s an open source library, they probably won’t care about 1.

      If you’re working on internal software used by other developers within the company, management probably really does care about 1 because it’s going to impact their timelines.

      If you’re working on a proprietary user-facing API, then even if it doesn’t cost your company anything management might still care because it could piss off valuable customers.

      I think that, for what ever decision OP is trying to make, looking at that context is more important than quibbling over what exactly constitutes a “breaking change.”