1 min read 65 words Updated Sep 24, 2026 Created Sep 24, 2026
#OOP#functionalprogramming

Inheritance is a concept that often appears in OOP (Object oriented programming).

Beginners are often taught examples that are ideal for the concept of inheritance - e. g. the vehicel - car example.

Composition is the idea of enabling reuse of code without depending on inheritance.
In typical OOP languages, composition usually means creating classes that include instance of other classes - instead of inheriting.