4 ms·
I agree with a lot of your points; ego is a dangerous thing. However, I think it's important to differentiate between the two major types of rewrites (or claims
by pdwetz 14y ago
I agree with a lot of your points; ego is a dangerous thing. However, I think it's important to differentiate between the two major types of rewrites (or claims as to why something should be rewritten): 1) The code is obviously subpar vs. 2) the programmer doesn't understand the code.
I've had to deal with code written by 3rd parties where I doubted the person was actually a programmer who wrote it; nonsensical or nonexistent naming conventions, large methods of dubious logic that were often never actually called (anymore?), and a general avoidance of best practices (and I don't mean advanced code; even simple things like code comments along the lines of "this is a for loop").
#2 is a different beast altogether and I think this more applies to your last paragraph. Is the source code too advanced for the programmer reading it, or is the code/architecture too obtuse? Unfortunately, I think it's often primarily programmer laziness more so than the design itself. I've been told by devs they don't understand a system and when asked what they don't understand, they simply shrug their shoulders. If you don't make an attempt to "get" the current system, in no way should you be allowed to rewrite it from scratch. You need to at least learn the mistakes of the current system.
- lukeschlather 14y agoPersonally I think it's rare that rewriting subpar code is a great idea. Some refactoring is frequently in order, but that's true in general. Even understanding the faults of an existing system, it's a big undertaking to rebuild it and make it better in one go. There is a certain class of code that is not merely subpar but actually can be easily rewritten with 1/10th the code and will be less buggy as a result. We may be talking about the same thing, but if so I think "subpar" is being too polite for code that will actually benefit from a rewrite.
- pdwetz 14y agoSorry, I could see how my use of subpar might have been a little vague. I meant horrible code that induces physical pain just by reviewing it.