3 ms·
Somehow everybody agrees with this, yet it is extremely rare to find anybody deleting much code. If not writing code is good, deleting code should be much bette
by ncmncm 8y ago
Somehow everybody agrees with this, yet it is extremely rare to find anybody deleting much code. If not writing code is good, deleting code should be much better. At least, delete the code that shouldn't have been written!
Me, I never feel quite so productive as when I have deleted 1000 lines of code. Sometimes I need to replace it with 20 or 100 lines, which is sad, but still a net improvement. Yet, most days I find I write more code than I delete.
There is a current fashion in C++ to eliminate loops from your code, replacing them with calls to generic algorithms -- written on the spot, if necessary. It is hard to see how this will be an improvement when you start, but after a series of minor transformations, the improvement accelerates and code just starts to seem to evaporate.