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

a comment base on my experiences #7

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 18 additions & 1 deletion 2021/barely-interface.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,24 @@ If anything, keeping things simple is often a good policy. If you start off wit

## Discussion

No comments. Want to make a comment? Edit this page. Then submit a pull request.
@icing: the dimension in code most overlooked is time. the interface/baseclass will need to evolve in ways
inforeseen today. If it is 'private', not visible outside your module/package, you retain every freedom to
modify both in any way.

If your interface/baseclass is visible to the outside, the interface is orders of magnitude less dangerous
to change than the 'abstract' base class. Especially when the abstract baseclass has any 'default' implementation
of a method (the 'code reuse' pit). These default implementation parts are never documented, and yet are part
of the contract to any inheritor of the base class.

The most brittle is the initialisation phase. When the constructors run top to bottom, it is often assumed
that all methods function that are part of the interface. Most implementation inheritancers become very surprised
when their class methods get called before the constructor has run.

Lots of pitfalls in your own code, but when the hierarchy is split among release lines, the behaviour
of the "other side" can change any time and break you. Not worth it.


Want to make a comment? Edit this page. Then submit a pull request.