DEV Community

Discussion on: I work hard in order to avoid work - My view on refactoring

Collapse
 
miketalbot profile image
Mike Talbot ⭐

I definitely agree with little and often refactoring - BUT - I also think there are times to take the 50,000ft view and say I could do a major thing here - and do some very serious moving around of stuff perhaps to make things more obvious.

My day job is building a ThingBuilder - a builder of things with literally 100s of plugins etc and quite a few devs. We recently completely restructured the code base for our plugins and after I am so happy, I must save minutes every hour finding the right code section now. We also refactored all of our file names into a new convention which is much easier to find in WebStorm search everywhere. Of course if you move a lot you'll need good tests :)

Collapse
 
nombrekeff profile image
Keff

Totally agree, as I mentioned in the post I also do refactoring periodically and from time to time I tackle major things that can't be done with the litle and often approach.

We recently completely restructured the code base for our plugins and after I am so happy, I must save minutes every hour finding the right code section now

That's always such a good feeling, and can relate quite a bit. As we recently re-wrote an app I was put in charge of, it was so bad we had to re-write it from scratch, no room for refactoring there. Working on that project now is so much nicer, easier to maintain, etc... I enforce refactoring on the project and don't allow the "I will do that later" syndrome that @inhuofficial pointed out!

And of course we do have tests, not the best but quite good :)