4 Refactoring existing code(or Refactoring doesn’t mean rewriting code)

This chapter covers

  • How to plan a refactor and what to consider while doing so
  • What to look for while refactoring code
  • Tools and techniques you can use to refactor code
  • Where refactoring code does not make any sense

Aside from unit testing, the importance of refactoring and the correct way of doing it is one of the most valuable things you can learn early in your career as a software developer. If you want to properly refactor your or other people’s code, you’ll have to learn all you can about best coding practices, and you’ll have to be able to pick up on anti-patterns that need to be broken down, rearranged, and cleaned up.

Ironically, doing a proper refactoring of a ...

Get Skills of a Successful Software Engineer now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.