On Monday, 24 August 2015 at 13:28:23 UTC, Atila Neves wrote:
On Monday, 24 August 2015 at 11:10:16 UTC, Dicebot wrote:
Rough summary of the talk I have given for recent Berlin D
Nice. I've only just started exploring code reuse with template
mixins, and used it to great effect in my last project. Blogs
like this are useful since there aren't many examples in other
languages (Ruby modules come to mind).
Inheritance certainly is 'the base class of all evil'. I have a
theory that the reason inheritance is so overused in OOP
languages lies in the way it is taught - the OOP aspects cover
much of the syntax of the language and hence much teaching
material revolves around inheritance. This makes the student
believe that inheritance is therefore the 'right way' to proceed.
Many years of pain have, however, taught me to avoid inheritance
and to prefer composition - even/especially when using e.g. Java.