DEV Community

Discussion on: I work hard in order to avoid work - My view on refactoring

Collapse
 
petermortensen profile image
Peter Mortensen

The main use for refactoring is not to improve bad code, but to reduce/eliminate redundant code.

Redundant code is often the result of copy-paste reuse (the worst kind of reuse), for very short-term gains. Instead of functional abstraction, code is copy-pasted and slightly changed, building up technical debt that can slow development to a crawl, often 10 times slower or worse.

Collapse
 
nombrekeff profile image
Keff

Yup, I totally agree. I have seen that kind of technical debt, a project of ours which was done in a copy-paste way without much thought, ended up with a tech-debt so big it would've taken us 2.5-3 years to remove. This project was 1 year old at the time