// denisdefreyne.com / notes
Last revised:
April 2021

Backwards compatibility (for behavior) is tough to get right

How does a bug fix differ from any other change in behavior? Why are bug fixes backwards compatible, but other changes are not?

Bug fixes are backwards compatible because the actual behavior differs from the expected behavior. Some bugs are obviously bugs (crashes, data loss, etc) while others are not obvious (e.g. relative path when it should have been an absolute path).

A bug could be subtly incorrect behavior that someone relies on. (e.g. expecting a relative path, and switching on first path component of that relative path). If that bug is fixed, then the behavior changes, which might create a bug for someone else.

The underlying issue is that the expected behavior is not clear.

Could statically typed languages help with this? This could help in minimizing expectations (and therefore wrong expectations).