Revision vs Rewriting

Hey, I was just wondering, for future reference, at what point do you rewrite old code, instead of continually revising it?
When revisions makes it hard to read or a rewrite would simplify it, ,and i have the time to rewrite. As you progress, every year your last year's code will look horrible. Not everything has to be rewritten, its the process of learning to program.
Last edited on
Me personally? Far less often then I should.
For my team, far too often.

Every time a new engineer gets assigned to a task, they look at the in-place code and say that it needs to be rewritten. I lead a group of 20 engineers, and EVERY time, without exception, the new guy says that it'll take less time to re-write than correct, or sometimes less time to re-write than to read. I have to avoid re-assigning tasks and need to hold on to the original authors just to avoid spending 80% of my time refactoring in order to actually get something done.
Rewriting is always more time consuming. I've learned this first hand.

But in some cases, it can be justified. For instance, there's a few rewrites currently happening for a few noticeable projects. One is the Open Broadcaster Software which is being re-written as obs-studio.

Usually, a rewrite is only wanted if there's major design changes. There needs to be very specific reasoning as to want to change a design, not just, "because its stupid" or "I don't like it" else you tend to just waste time implementing the same exact thing in a different way.
closed account (3hM2Nwbp)
Generally, I only rewrite things when a new standard is published to take advantage of constructs that vastly improve the code. IE template aliases instead of a boat-load ^of specialized typedefs.
Last edited on
Topic archived. No new replies allowed.