1 points · by rhlala · 9y ago · 3 comments
Right now i try to take one full day of work each week only refactoring, good habit?
Maybe i will try do it everyday before continue work, refreshing yersterday code by refactoring seems good idea,
When and how do you refactor your code?
I'd say for me, its when I can see that I can make something more efficient or spot obvious mistakes or slipshod code. So it could be once a week, once a day, once an hour.. or months later when I come back to something and see that I could approach it differently.
Regardless, I like where your thought process is going on this, that you're always looking to make your code a bit better whenever you can. :)
If I anticipate typing the same thing again I'll prefactor and head it off at the past.
If you can get official refactoring time that's great; I've only worked at one place where we had official refactoring time built into our sprints, which can be frustrating.
"How" is impossible to answer in a general way other than restating all the usual refactoring patterns.