Don’t refactor on a Friday afternoon!
If you work in a 9-5 environment, then the biggest mistake you can possibly make on a Friday afternoon is to start major changes in your code. Stop! Step away from the keyboard! This one goes right up there with never sending an email late at night (especially when you’re tired or cranky) or discussing work/money in bed.
I learned this lesson on my own and it bears repeating, because even after all these years I still catch myself doing it sometimes. It’s Friday, you’re tired, and when your guard is down that’s when you start doing stupid things to your code.
So go write some documentation or as Marc-André Cournoyer suggested, fix the little things that you told yourself you’d do later but never did or add some tests. Just stay away from major changes on a Friday afternoon!


this is funny. i picture you cursing and doing reverts with svn right now
Hey Chris,
Although I agree you should not start any big refactoring on friday (or anything big at all), I think friday is the perfect time to fix the little things that you told yourself you’d do later but never did.
Like refactoring that each or times block to inject, fixing the html in views. Things that just make your code looks cool.
Or maybe adding some tests breaking existing code.
Just really tiny refactoring that ease the mind are fun and help you leave the office with a great sense of “devoir accompli”.
In communist Russia, code refactors *you*!
macournoyer is right, the examples I listed weren’t necessarily the most productive ones. I’ve updated the post as a result. On the other hand, Friday afternoon seems to be ideal for posting on one’s blog.
Generally, refactoring or optimization should be the last thing you do.
If you have lots of programming experience, then some optimized constructs should come immediately, but otherwise you should concentrate on writing code which works.
Also, if you’ve spent enough time doing the functional specs and the design, you’d not need that much refactoring.