Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Article BC break part 1 #777

Closed
wants to merge 7 commits into from
Closed

Conversation

matks
Copy link
Contributor

@matks matks commented Sep 17, 2020

This article is the 1st part of a big article explaining what exactly are Backward Compatibility Breaks also known as Breaking Changes or BC breaks.

This article

  • introduces the concept of dependency and dependency API interface
  • explain what is a Breaking Change
  • explain SemVer

I am not yet sure whether I should append to this part 1 the next part "BC breaks come in many shapes on PrestaShop project, how do we deal with them" or it should be another article.

This is WIP, I need to

  • rewrite it a bit more, find better words, better expressions, better ways to explain
  • better explain SemVer (it's just a summary for now)
  • provide a few more examples maybe

Fixes #704 partially

@Progi1984 Progi1984 added the WIP Work in progress label Sep 23, 2020
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
}
```

This is possible because the class is not [final](https://www.php.net/manual/en/language.oop5.final.php) so it is open for inheritance. It can be then considered that this class, and all of its protected and public properties and methods, are part of the API interface of this project. This means than any non-backwards compatible change to this class is a Breaking Change.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This means that any non-backward compatible change to this class is a Breaking Change

news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
@matks
Copy link
Contributor Author

matks commented Sep 26, 2020

Thanks for the proofreading @sowbiba !

@matks
Copy link
Contributor Author

matks commented Sep 27, 2020

Added some more this evening. I think the size is decent, and the "what about BC breaks in PrestaShop" is somewhere near 200 lines of code so I will keep the articles split in two.

To finish this one, I believe I need

  • to rewrite a bit the "explicit vs implicit contract" part ; maybe add an example
  • to rewrite a bit the last part "why BC breaks" ; maybe add an example
  • harmonize terms used, tone used, paragraphs statements
  • add a conclusion

@matks matks removed the WIP Work in progress label Oct 2, 2020
@matks matks changed the title [WIP] Article BC break part 1 Article BC break part 1 Nov 5, 2020
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
news/_posts/2020-09-17-bc-break-part-1.md Outdated Show resolved Hide resolved
Co-authored-by: Pablo Borowicz <pablo.borowicz@prestashop.com>

If a project integrates this library as a dependency and wishes to extend this behavior, a very standard way to do so is to use [inheritance](https://en.wikipedia.org/wiki/Inheritance_(object-oriented_programming)).

For example maybe project A needs a Money object with an identifier ? So it could create its own child class:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
For example maybe project A needs a Money object with an identifier ? So it could create its own child class:
For example maybe project A needs a Money object with an identifier? So it could create its own child class:


BC breaks are a [hindrance](https://www.snoyman.com/blog/2018/04/stop-breaking-compatibility) for the users of a dependency as they require an upgrade of the code relying on it. So it seems getting rid of them, never introducing BC breaks would be a nice idea, right?

Unfortunately BC breaks are necessary for software to evolve. Maintaining backward compatibility strongly limits the options of the dependency maintainers and can stand in the way of necessary evolutions. This is why they are needed and why they are introduded in new major releases.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Unfortunately BC breaks are necessary for software to evolve. Maintaining backward compatibility strongly limits the options of the dependency maintainers and can stand in the way of necessary evolutions. This is why they are needed and why they are introduded in new major releases.
Unfortunately BC breaks are necessary for software to evolve. Maintaining backward compatibility strongly limits the options of the dependency maintainers and can stand in the way of necessary evolutions. This is why they are needed and why they are introduced in new major releases.

@matks
Copy link
Contributor Author

matks commented Oct 1, 2021

Closing after 1 year. Not needed anymore.

@matks matks closed this Oct 1, 2021
@matks matks deleted the bc-break-part-1 branch December 18, 2023 13:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Article idea] Different kinds of Breaking Changes
5 participants