4 ms·
It’s easier to throw away bad code and start over than to change it. You had me nodding along until I came across this. This single sentence is not just wrong,
by palish 16y ago
It’s easier to throw away bad code and start over than to change it.
You had me nodding along until I came across this. This single sentence is not just wrong, it's so wrong that it unfortunately calls the rest of the article into question.
- hnal943 16y agoIt is easier. Whether it's better or faster is another question.
- palish 16y agoThe whole reason to even list any programming truths is because they would make you a better and faster programmer.
- bconway 16y agoThe whole reason to even list any programming truths is because they would make you a better and faster programmer. Says who? Truths are not always good things. That doesn't make them any less factual.
- palish 16y agoI'd say having a firm grip on reality can only make you a better programmer.
- loup-vaillant 16y agoYou. Not others. If you stop writing bad code, that doesn't stop others to write bad code. That doesn't mean you won't maintain bad code.
- deleted 16y ago[deleted]
- mcantor 16y agoHe was using "easy" the same way Python programmers use "clever"--derogatorily. It is easier to throw away bad code and start over, but the easy way and the best way are rarely the same. Actually, it might be easier to say that it's easier in the short run. Refactoring may be deceiving because it's harder up front ("Ughhh, I have to read all of this awful code") but easier in the long run ("Ahh, look how seamless everything is!"); as opposed to rewriting, which is easy up front ("Look at the pristine, unmarred beauty of this empty file! I will fill it with my brilliant ideas.") and horrible in the long run ("What do you mean, all of the bugs that were fixed in our old broken code have resurfaced and need to be fixed again?!").
- extension 16y agoDepending on how much functionality needs to be changed, and how the new developers compare in skill to the old ones, it could very well be easier and a better choice in every way.
- jemfinch 16y agoStudies have shown (see McConnell's *Code Complete for citations) that bugs are far new likely to recur in previously buggy code than in code not yet found to be buggy. Since so much time in development is spent in testing and debugging, it's not at all unreasonable (based on studies or on my personal experience) to claim that it's easier or better or faster to rewrite code rather than try to fix it. This dovetails quite reasonably with Brooks' claim that we should plan to throw one away, because we will anyway.