Motivations to refactor code

I read a post a few weeks ago about refactoring code and the motivations thereof. Since then, I’ve come across one or two other posts regarding the same topic, but they’ve all seemed to neglect one of my main reasons for refactoring code: self-satisfaction.

I’m the first to admit that I don’t write perfect code. Some may argue that I don’t even write good code (although that would be somewhat depressing, mind you). However, I do write the best code I know how to write. And if I learn a better way, I want to go back and re-write (er, refactor) that code. Knowing that I have a clean code base makes me more focused and motivated to do even better. It’s an infinite cycle.

I realize not every developer cares a whole lot about his/her code base, but I think the good one’s do. I get sick if I’ve left code uncommitted, and experience anxiety when thinking of something I need to go back and “do better”. There’s a whole ‘nother wave of motivation when trying to improve already-working code. It sometimes removes the problem-solving aspect and allows you focus on efficiency and readability. It’s fun to say the least.

So… self-satisfaction is near the top of my list of motivations to refactor code. The end.

Comments

Have something to say?
Please rewrite the image text Are You Human? Hint: Are You Human? Formatting Tips

or

© 2008 Ryan Heath | Site Management A Ruby on Rails production.

Get in Touch