๐—ฅ๐—ฒ๐—ณ๐—ฎ๐—ฐ๐˜๐—ผ๐—ฟ๐—ถ๐—ป๐—ด ๐—œ๐˜€ ๐— ๐—ผ๐—ฟ๐—ฒ ๐—ง๐—ต๐—ฎ๐—ป ๐—–๐—ผ๐—ฑ๐—ฒ

Most people think refactoring is about removing duplicates. They think it is about changing names. It is more.

Good refactoring starts before you open your editor.

You must understand the context. You need to know the business state. You need to know the technical limits. You need to know the deadlines. You need to know the team skill level at the time.

It is easy to judge old code. It is hard to admit the old code was the best choice then.

Sometimes the code is not the problem:

Old solutions stop working when needs change.

Refactoring is an exercise in understanding. Learn why the system is the way it is. Code holds stories. These stories are not in tickets or documentation.

Good refactoring does not aim for beauty. It preserves knowledge. It prepares your system for future challenges.

Understand the past to build the future.

Source: https://dev.to/camilasrody/refatoracao-nao-e-apenas-sobre-codigo-ki8