2 ms·
If you want to have an easy time refactoring code later, forgo OO patterns that have properties and methods in the same class. Instead, make classes for your da
by euroclydon 9y ago
If you want to have an easy time refactoring code later, forgo OO patterns that have properties and methods in the same class. Instead, make classes for your data, and make sure to give each class a deep clone method.
Then, your logic goes in static functions that do not alter the input, but rather spit out new or cloned versions of the data in the output. Then you can reason and refactor at the method layer and not worry about hidden side effects.
- sqeaky 9y agoThat seems a bit extreme compared to where many teams are at, but I can see how it could work. How would you compare that to reducing the size of classes to bound where side effects can happen?