Should I Rewrite?

I have recently rewritten some code and have observed some people I work closely with rewrite code. There’s a lot of debate on when to refactor, when to rewrite, and when to move on. I recently came across a post from Thomas Davis that has made its way around /r/programming and speaks well on the issue. (https://github.com/thomasdavis/best-practices)

Something a lot of developers experience at some point in their career is taking over someone else’s software. This means they are responsible for new features and of course maintenance. Let’s face it, a lot of times we have to take over code that we think is shit. At some point you might find yourself struggling to add a feature but are nervous at every step that you will unobviously break some functionality. I see a lot of developers hit this point and decide to rewrite software. Although it might not be the best decision, I don’t think it is necessarily wrong. Here are some benefits:

Of course, patterns repeat. You will eventually move on to something else and another developer will take ownership of your code. They will say it’s shit, berate your code, and finally rewrite it.