3 ms·
+1 for this list. Choosing composition over inheritance is generally a good idea, but if the language doesn't support declarative/automatic delegation, building
by neeleshs 4y ago
+1 for this list.
Choosing composition over inheritance is generally a good idea, but if the language doesn't support declarative/automatic delegation, building good compositions becomes tedious. Still, inheritance, when used for code reuse, breaks LSP (https://en.wikipedia.org/wiki/Liskov_substitution_principle https://en.wikipedia.org/wiki/Liskov_substitution_principle) and the problems typically manifest, months or years down the line when you try to extend such areas of code