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

Popular Tags

Recent Comments

  • Wed Nov 19 by xxxRAWxxx

    There’s a new one for you. Can’t believe I stumbled ...

  • Wed Nov 19 by Chris

    @Ryan, @Nick – well, I’m glad I’ve been of help, ...

  • Tue Nov 18 by Ryan

    Ha! Yeah, it is a little awkward. Good thing I don’t actually...

  • Tue Nov 18 by Chris

    While your explanation is sound, I cannot bear the hear the audible...

  • Tue Nov 18 by Ryan

    I suggest looking into unobtrusive javascript, especially since you...

  • Tue Nov 18 by Nick

    Update – I found out that my inclusion of jQuery was causing ...

  • Tue Nov 18 by Nick

    I had something about 20% developed in PHP and got sick of it. It&#...

Flickr Photos

  • Desolate
  • Along the fence
  • Blurred
  • Darting
  • One rose left
  • Farm entry
  • Watch your step
  • Back to work

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

Get in Touch