Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualServant of the Lord

Posted 22 September 2012 - 09:36 PM

I don't refactor while in the middle of making changes, but yeah, I refactor when needed between changes or after changes.
I don't refactor for refactoring's sake, but only when the code is messy or will soon become messy through changes that refactoring could prevent.

As Geometrian says, it's best to write it clean the first time. My code usually is clean the first time, and only accumulates cruft over time from additions - that's when I refactor. Occasionally (but not too commonly), I need to refactor after writing it the first time because I had difficulty comprehending the first time through. I'm talking function-level refactoring, not architecture-level refactoring. I have to do architectural refactoring every so often because I'm still learning good architecture and make alot of mistakes there.

Code Complete is worth the money when you can get it.

#2Servant of the Lord

Posted 22 September 2012 - 09:35 PM

I don't refactor while in the middle of making changes, but yeah, I refactor when needed between changes or after changes.
I don't refactor for refactoring's sake, but only when the code is messy or will soon become messy through changes that refactoring could prevent.

As Geometrian says, it's best to write it clean the first time. My code usually is clean the first time, and only accumulates cruft over time from additions - that's when I refactor. Occasionally (but not too commonly), I need to refactor after writing it the first time because I had difficulty comprehending the first time through. I'm talking function-level refactoring, not architecture-level refactoring. I have to do alot of architectural refactoring because I'm still learning good architecture and make alot of mistakes there.

Code Complete is worth the money when you can get it.

#1Servant of the Lord

Posted 22 September 2012 - 09:32 PM

I don't refactor while in the middle of making changes, but yeah, I refactor when needed between changes or after changes.
I don't refactor for refactoring's sake, but only when the code is messy or will soon become messy through changes that refactoring could prevent.

PARTNERS