[ $davids.sh ] โ€” david shekunts blog

๐Ÿ” Composition over Inheritance in OOP and FP

# [ $davids.sh ] ยท message #83

๐Ÿ” Composition over Inheritance in OOP and FP

New article: https://fop.davidshekunts.ru/fop-vs-oop/composition-over-inheritance

Let's break down the second most important pillar of OOP - "Inheritance"

This principle is not even liked by OOP supporters themselves, since in more or less long-lived projects it brings more problems than the supposed benefits

That's why I'll first show an alternative to Inheritance in OOP itself, and then explain how you won't have to deal with this kind of problem in FP at all, since you'll have Composition out of the box

#fop