{"id":372,"date":"2008-03-26T16:16:00","date_gmt":"2008-03-26T16:16:00","guid":{"rendered":"http:\/\/sdi.thoughtstorms.info\/?p=372"},"modified":"2008-03-26T16:16:00","modified_gmt":"2008-03-26T16:16:00","slug":"372","status":"publish","type":"post","link":"https:\/\/sdi.thoughtstorms.info\/?p=372","title":{"rendered":""},"content":{"rendered":"<p>Sometimes you need to take a step back from a problem, to see the forest for the trees.<\/p>\n<p>GeekWeaver was being held up by something that seemed a rather complicated knot; one that I&#8217;ve wrestled with a number of times but never really untangled to my satisfaction. <\/p>\n<p>So last night I decided to restart with a clean slate. I didn&#8217;t look at the existing code or existing unit-tests. Didn&#8217;t even open my IDE or project file.<\/p>\n<p>I just started up IDLE and in a single file, redid the whole thing from scratch, in a fast test-driven stylee. <\/p>\n<p>Amazingly I think I&#8217;ve come out with a cleaner solution, messing around with fewer classes and no attempt to over-re-use with inheritance. The whole thing took about two hours total. Of course, it&#8217;s not quite finished, and still needs to be integrated back into the main codebase. But I like it a lot more. It&#8217;s shorter and easier to understand. <\/p>\n<p>Sometimes (at a certain granularity) old code *is* more of a burden than an asset. Understanding what it does and what you can do it is a cognitive cost that outweighs its value. Don&#8217;t be afraid to throw code away when you need to. <\/p>\n<p>Caveat for small granularities. Obviously rewriting an entire application from scratch is <a href=\"http:\/\/www.nooranch.com\/synaesmedia\/wiki\/wiki.cgi?ThePerfectRewrite\">a different matter<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sometimes you need to take a step back from a problem, to see the forest for the trees. GeekWeaver was being held up by something that seemed a rather complicated knot; one that I&#8217;ve wrestled with a number of times but never really untangled to my satisfaction. So last night I decided to restart with [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[173,354],"class_list":["post-372","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-geekweaver","tag-programming"],"_links":{"self":[{"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/372","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=372"}],"version-history":[{"count":0,"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=\/wp\/v2\/posts\/372\/revisions"}],"wp:attachment":[{"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=372"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=372"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sdi.thoughtstorms.info\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=372"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}