3 ms·
Changing an existing class (modification) is possibly bad, because it can introduce bugs. The code was working, you made a change, oops! Adding a new class (wh
by mdpopescu 7y ago
Changing an existing class (modification) is possibly bad, because it can introduce bugs. The code was working, you made a change, oops!
Adding a new class (when the code was written to be extensible) should prevent that.
See for example [1] where Sandi Metz shows how to rewrite some incredibly complex code to make that possible.
[1] https://www.youtube.com/watch?v=8bZh5LMaSmE https://www.youtube.com/watch?v=8bZh5LMaSmE