๐ฅ๐ฒ๐ณ๐ฎ๐ฐ๐๐ผ๐ฟ๐ถ๐ป๐ด ๐๐ ๐ ๐ผ๐ฟ๐ฒ ๐ง๐ต๐ฎ๐ป ๐๐ผ๐ฑ๐ฒ
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:
- The business changed.
- The team changed.
- The requirements evolved.
- The scale grew.
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