4 ms·
Exactly. It's too easy to break Zawinsky's first commandment (Thou shalt not break working code) with changes like this. Sure, if the code is getting in the way
by quanticle 14y ago
Exactly. It's too easy to break Zawinsky's first commandment (Thou shalt not break working code) with changes like this. Sure, if the code is getting in the way of a change, then go ahead and change it. But I don't think that's what the questioner is asking. It seems like he or she has noticed this "ugly" code and wants to change it out of a misplaced sense of conscientiousness.
EDIT: I just remembered that something like this happened to me when I was an intern at my first position doing "real" software development. I'd noticed a particular piece of gnarly code and asked my team lead for permission to refactor. He, in turn, told me that for a rarely used code path like the one I was proposing to refactor, the costs of QA and deployment would greatly outweigh any savings my changes would generate for the company. His concluding words were, "Sometimes it's easier to let sleeping dogs lie," and I think that's something that applies to this situation as well.
- MBlume 14y agoFirst paragraph: > Sometimes you run into a situation where you have to extend/improve some existing code. You see that the old code is very lean, but it's also difficult to extend, and takes time to read. Last paragraph: > Is it a good idea to change such code if you have to touch a small piece of it either way?