2 ms·
The thing is: "If you are using copy and paste while coding you are probably committing a design error" doesn't conflict at all with what he says. The fact is
by einhverfr 14y ago
The thing is:
"If you are using copy and paste while coding you are probably committing a design error" doesn't conflict at all with what he says. The fact is that copy and paste is the point when one looks and says "is refactoring appropriate here?"
One thing I would point out is that premature optimization is the root of all evil. You can get a pretty good sense that if your refactor adds more lines than it deletes and functionality remains the same, that you have added complexity in refactoring which means very likely that you are doing it wrong. This is particularly true if you can't say it is reducing the number of lines of code generally, or compartmentalizing state changes.
(This leaves aside the fact that the most pernicious use of copy and paste in the world is "sample code.")