stampit icon indicating copy to clipboard operation
stampit copied to clipboard

📚 Stamps vs Traits vs Mixins vs Has-a/Is-a composition vs Multiple inheritance (classes) feature-by-feature comparison

Open dwiyatci opened this issue 5 years ago • 3 comments

It's been ¬5 years I've got acquainted with stamps, been visiting the GitHub repo and using them once in a while in my project. ;) That said, I still feel shaky/undecided sometimes whether it's the best approach out there to do composition in OOP. Okay, one of the "Fun with Stamps" articles claims that this could be the most superior:

Classic class-based OOP is rather limiting of what you can and cannot do with your classes. It has certain rules about how the inheritance works. They are set and unchangeable. TraitsJS and mixins are the same — more flexible though, but limited.

Stamps are free. No limits of what you can compose.

Yet, there is no clear feature-by-feature comparison between the contenders:

  • Stamps.
  • TraitsJS.
  • Mixins.
  • Has-a composition.
  • Is-a composition.
  • Multiple inheritance (classes)? Others?

I think it would be fascinating to see a fair and rather non-biased feature-by-feature comparison matrix/table (maybe like in https://webpack.js.org/comparison/ (?)) to mark a cool legacy in software engineering for the human race has ever been invented here.

Bless! :)

dwiyatci avatar Apr 21 '19 13:04 dwiyatci

This is an amazing idea! I need some time to work this all out. Thank you.

PS: feel free to drop more ideas.

koresar avatar May 13 '19 11:05 koresar

I've been reading Elliotts latest book and got interested in Composition and thus Stampit. I've been wanting to use it in projects but have a nagging feeling that I'll get into trouble, get locked in or not be able to find a solution to problems I might encounter in bigger projects.

I think this type of comparison would convert a lot of doubters, superb idea and really nicely formulated :-)

tmikaeld avatar Jul 02 '19 18:07 tmikaeld

Superb idea, really need those types of comparisons to better understand the whole thing.

StephaneTy-Pro avatar Apr 05 '22 08:04 StephaneTy-Pro