logo CodeFTW

CodeFTW

Subscribe
Back6/25/24, 12:25 PM

Refactoring: Making Good Code Better

and it's not fixing bugs

Today, we're talking about refactoring. It's an important skill for all coders, and here's why:

What is refactoring?

Refactoring is when you change code that's already working well. You don't change what the code does, but you make it better in other ways.

Why refactor?

We refactor to:

  • Make code easier to understand
  • Make it easier to maintain over time
  • Make it easier to read and review

When to refactor?

Refactor code that you plan to use for a long time. Don't waste time refactoring code you'll only use once or twice.

What refactoring is not:

  • Fixing bugs (that's just regular coding)
  • Rewriting everything from scratch
  • Changing to a new technology

Remember:

We write code for humans, not machines. Good code is easy for other people to read and understand.


If you want to learn more about refactoring, check aiproofdev.com