4 ms·
>Counterpoint: rewriting your code from scratch is the worst mistake you can make. Joel Spolsky's essay is more about rewrites of "ugly" code. E.g. Fix the di
by jasode 8y ago
>Counterpoint: rewriting your code from scratch is the worst mistake you can make.
Joel Spolsky's essay is more about rewrites of "ugly" code. E.g. Fix the disorganized code by gradually refactoring into cleaner modules over time instead of a total blank slate rewrite.
In contrast, this Geoff Greer essay is about paradigm-shifting software architectural changes which by their nature, are very difficult to retrofit into an old existing code base. For these, it's often easier to start coding with a "blank slate" rewrite.
As examples Geoff's category of rewrites (new architecture paradigm) vs Joel's category (unhygenic code cleanup), we can look at Joel's ex-employer Microsoft:
- SQL Server database diverged from original Sybase code and rewrote the engine. One of the architecture changes was switching from page locks to row-level locks
- C# compiler completely rewritten from C++ code base to C# codebase. One architecture change was "compiler exposed as a libary service" instead of being the closed "black box" that was assumed by the C++ code.
- operating system: MS Windows NT as a blank slate operating system instead of gradually extending old 16-bit DOS code or 16-bit Windows 1.0 code. One motivating architecture change was the new 32-bit protected mode on the newer Intel 286 & 386 chips. Another factor was the switch from "cooperative multitasking" to "preemptive multitasking".
- thunderbong 8y agoThank you for putting that so clearly and succinctly. Somehow, I always felt uncomfortable reading Joel's article because I had never seen spaghetti code on large code bases. I now realize that it is because I've been using open-source code bases for quite some time and that is probably the reason why. Recently however I saw some enterprise in-house code and that's when everything fell into place!!
- gwern 8y agoAnd it's worth noting that Spolsky left MS & wrote that essay well before MS had its "come to Jesus" moment when it came to security. A fanatical emphasis on backwards compatibility & avoiding rewrites was not helpful for avoiding that crisis.