4 ms·
I always found getters and setters very helpful for this case. In C++ and in Java. Doubly so in Java because the following works: 1) field is no longer importa
by iofj 11y ago
I always found getters and setters very helpful for this case. In C++ and in Java. Doubly so in Java because the following works:
1) field is no longer important, gets replaced
2) write a getter that still gets the value of it, but delete the field itself.
--- this is where it stops for C++
3) use the "inline function" refactoring on your entire codebase
Done/done. You don't even have to rewrite the tests, in fact it might be better not to.
(Of course getters and setters are somewhat verbose in most cases. Object pascal has the perfect solution though)