3 ms·
Correctly using a language feature often means using it for more than one reason. Extending superclass code can be well advised in case it also makes sense sema
by ahartmetz 6y ago
Correctly using a language feature often means using it for more than one reason. Extending superclass code can be well advised in case it also makes sense semantically. Now, I have seen a "mixin" class that just served to provide one relatively independent method, and I turned it into a free function. Much better. In other cases, an extended class works on the whole state of the object. In that case it usually makes sense.