Refactoring is about features

  • Always refactor in the service of a feature.
  • Find code that is frequently being worked on. Try to refactor that code.
  • It seems faster to write a new feature in a complex system than to refactor the old system first and then add the new feature. But the overall time that you would spend debugging, rolling back releases, sending out bug fixes, writing tests for complex systems will be lesser of you refactor first.
  • Pick a feature that you want to implement, and figure out what you could refactor that would make it easier to implement it.
  • Set boundaries around your code. Eg: “I’m not going to refactor anything outside of my project to get this feature done.”
  • “There is no perfect design, there is only a better design.” So, avoid over-engineering or spending too much time on figuring out how to refactor something.

Full post here, 10 mins read