<story><title>Lessons learned from rewriting code</title><url>http://huseyinpolatyuruk.com/2019/02/04/lessons-learned-from-rewriting-code-in-my-10-years-as-a-developer/</url></story><parent_chain><item><author>kasperni</author><text>&amp;quot;Rewriting a system from the ground up is essentially an admission of failure as a designer. It is making the statement, “We failed to design a maintainable system and so must start over.” &amp;quot;&lt;p&gt;Or maybe the domain you are working with was vastly more complex than you imagined, so your nice little system turned out to be more of a prototype than a finished product. Or maybe the features needed was vastly different from what you expected when you started implementing the thing. I&amp;#x27;m sure everyone can come up with a million other reasons.&lt;p&gt;But the problem I have every time with these &amp;quot;Never rewrite your software&amp;quot; stories. Is that they are almost always one-sided. You rarely hear about the stories where a company decided not to do a rewrite and was out-innovated because every little feature took months to implement. Or failed because they could not attract competent developers because their codebase was a complete mess.&lt;p&gt;Yes, the rewrite might have been a partial or complete failure. But would the patient have survived without the operation anyway?</text></item></parent_chain><comment><author>hinkley</author><text>That doesn&amp;#x27;t sound like an &amp;#x27;or&amp;#x27; to me.  That sounds like a &amp;#x27;why&amp;#x27;.&lt;p&gt;A rewrite also means no new features for a very long time.   And my very cynical view is that people asking for a rewrite are motivated by the peace and quiet that happens during the first six months of the rewrite.  In a world where people leave after 3 years and get a pass for their first few months that represents a pretty large fraction of their tenure.&lt;p&gt;But it&amp;#x27;s a bit like rehab.  You&amp;#x27;ve decided to start over with a new set of habits and hope it sticks.  But like rehab or new year&amp;#x27;s resolutions, the relapse rate is high.&lt;p&gt;My current take is that there is a paradox here.  The teams that deserve a rewrite usually don&amp;#x27;t need a rewrite.  There&amp;#x27;s a high degree of overlap between being capable of fixing your broken crap properly and being able to refactor to a better system.&lt;p&gt;The only rewrites I&amp;#x27;ve seen work look like the Ship of Theseus.  As far as management is concerned it&amp;#x27;s not a new system.  But the old developers can barely recognize the code.</text></comment>
<story><title>Lessons learned from rewriting code</title><url>http://huseyinpolatyuruk.com/2019/02/04/lessons-learned-from-rewriting-code-in-my-10-years-as-a-developer/</url></story><parent_chain><item><author>kasperni</author><text>&amp;quot;Rewriting a system from the ground up is essentially an admission of failure as a designer. It is making the statement, “We failed to design a maintainable system and so must start over.” &amp;quot;&lt;p&gt;Or maybe the domain you are working with was vastly more complex than you imagined, so your nice little system turned out to be more of a prototype than a finished product. Or maybe the features needed was vastly different from what you expected when you started implementing the thing. I&amp;#x27;m sure everyone can come up with a million other reasons.&lt;p&gt;But the problem I have every time with these &amp;quot;Never rewrite your software&amp;quot; stories. Is that they are almost always one-sided. You rarely hear about the stories where a company decided not to do a rewrite and was out-innovated because every little feature took months to implement. Or failed because they could not attract competent developers because their codebase was a complete mess.&lt;p&gt;Yes, the rewrite might have been a partial or complete failure. But would the patient have survived without the operation anyway?</text></item></parent_chain><comment><author>bdcravens</author><text>Sometimes when you&amp;#x27;re designing a system, you acknowledge it&amp;#x27;s bad (ie, technical debt). Ultimately, your purpose is supporting the system (typically the business), not crafting artisanal design and code. I suspect there are many beautiful git repos that are deleted when companies close their doors.</text></comment>