DEV Community

Discussion on: How do you schedule time for code refactoring?

Collapse
 
iedaddy profile image
iedaddy

ReFactor Fridays.

I always schedule a 4 hour chunk every Friday afternoon for code sanity. Despite the name, it doesn't always involve refactoring, sometimes it's just cleaning up a couple comments or hacks or other code janitor things.

I try to avoid writing new code though, and just work on making sure that it's not going to be embarrassing to show it to someone else.

Collapse
 
georgeoffley profile image
George Offley

That's what a few people have suggested. I was thinking about doing the same thing. I believe doing that may help keep it all up. Especially since it's just me!

Collapse
 
iedaddy profile image
iedaddy

It's definitely an investment that pays off, especially if you're working on multiple projects with different architectures and logic streams.

General rule of thumb for me is that if you're working on code that you're not going to touch on a regular basis every couple of months, it might as well be written by someone else - so comment and restructure it the way you're want it to be for you as if someone else had written it. The developer you are today is not who you're going to be 6 months from now.

Scheduling time is important though, otherwise it gets buried as just one more task that you'll get to "eventually". The bonus for scheduling it Friday afternoons is you avoid those Friday afternoon meetings because you're booked as "busy"