Need to refactor?

Why should companies invest in refactoring components when it isn't going to add any new feature to the product?

I agree that this is to clear code, fix bugs, and remove dead code - but what's the take?

+1


source to share


7 replies


Maintenance. This will significantly reduce maintenance costs. There is no comparison between fully factored code and the junk found in most company repositories. The latter is practically useless, and the former is gold.



+10


source


It depends on who you are asking about. A non-technical manager might say there is no need. The support developer would say this would help reduce maintenance costs.



+2


source


Refactoring should be part of your daily work. You are constantly refactoring your code to make it more readable / maintainable / reliable / reusable, etc.

Your code is a living document. If it does not change over time, it becomes stagnant.

Invest in testing. Invest in refactoring. Invest in writing good code.

+1


source


content. Sometimes a project gets large or has too many "quick" patches to expand further. You just need to sit quietly, cleanly and refactor.

+1


source


While the other answers are correct, the power of Refactoring is that it allows you to redesign your code with predictable results. The biggest maintenance challenge is that it is nearly impossible to predict all the requirements for complex applications.

Most of them can be solved by adding a new feature such as a new report or command. But others will require re-developing part of your application. This is where refactoring and unit testing comes into play. By using refactoring techniques, you can safely make the necessary design changes.

This is not a cure for the entire technique, but another tool that improves the quality of your code. (initial programming, object orientation, etc.).

+1


source


For starters: Refactoring is a tax. If the code works, then you are wasting time fixing the code that already works, now I see that the kinds of businesses look suspicious. The message I love is "Legacy is another word for code that works."

There are now a lot of problems with a growing code base that must be addressed before you start spending more time maintaining the code that develops functions.

I personally like the No Broken Windows philosophy.

0


source


If it's not broken, don't fix it.

But if you need to start installing components into new unpredictable requirements, then it is often necessary to identify bits that you can extract and reuse. You need to make sure that your changes introduce unexpected errors - so you need good test coverage.

0


source







All Articles