[{"data":1,"prerenderedAt":52},["ShallowReactive",2],{"$f3sf7fmy9ai0ng":3,"recommended":21},{"title":4,"path":5,"date":6,"updated":7,"tags":8,"excerpt":10,"readingMinutes":11,"commentCount":12,"html":13,"comments":14,"next":15,"prev":18},"Necessary Evil","\u002F2018\u002F10\u002Fnecessary-evil\u002F","2018-10-07T21:16:00.001Z","2018-10-07T21:58:39.894Z",[9],"programming","In one of the codebases I've worked with we had a module called \"NecessaryEvil\". All of the dirty hacks were put in there. This had three good outcomes: We could track our technical debt by looking at the size of the…",1,0,"\u003Cp>In one of the codebases I've worked with we had a module called &quot;NecessaryEvil&quot;. All of the dirty hacks were put in there. This had three good outcomes:\u003C\u002Fp>\n\u003Col>\n\u003Cli>We could \u003Cstrong>track our technical debt\u003C\u002Fstrong> by looking at the size of the module (and the references to it)\u003C\u002Fli>\n\u003Cli>Every time you saw a reference to a method in NecessaryEvil, your brain made a shortcut and instantly reminded you of how the thing you were looking at &quot;worked&quot; (that is: via a dirty hack, or in a non-intuitive way). This alone \u003Cstrong>saved a lot of time in debugging\u003C\u002Fstrong>.\u003C\u002Fli>\n\u003Cli>Over time the framework we used got more features. Every now and then we looked at stuff in &quot;NecessaryEvil&quot; and found things that could now be solved \u003Cem>properly\u003C\u002Fem>. This was \u003Cstrong>highly motivational\u003C\u002Fstrong> to the developers, because (a) it gave them a sense of ownership and (b) they saw the progress of the framework we used.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>I highly recommend to \u003Cstrong>make your &quot;dirty hacks&quot; explicit in your code base\u003C\u002Fstrong>. Here is how you should do it:\u003C\u002Fp>\n\u003Col>\n\u003Cli>Put all the dirty hacks in a directory \u002F module \u002F package where possible.\u003C\u002Fli>\n\u003Cli>Where #1 is not possible: add `dirty_hack_` or `DirtyHack` in the function or variable names. Don't put this in the comments, because comments don't show up in references, call stacks or stacktraces.\u003C\u002Fli>\n\u003Cli>Add a measurement to your CI infrasture that counts the amount of DirtyHacks and references to DirtyHacks in your codebase.\u003C\u002Fli>\n\u003C\u002Fol>\n\u003Cp>Happy hacking!\u003C\u002Fp>\n",[],{"title":16,"path":17},"Code Should be Readable","\u002F2018\u002F10\u002Fcode-should-be-readable\u002F",{"title":19,"path":20},"Every Day Shampoo","\u002F2018\u002F10\u002Fevery-day-shampoo\u002F",[22,27,32,35,39,42,45,49],{"title":23,"path":24,"note":25,"series":26},"Mapping out Dark Code","\u002F2026\u002F03\u002Fmapping-out-dark-code\u002F","2026",false,{"title":28,"path":29,"note":30,"series":31},"The software that I love","\u002F2022\u002F10\u002Fthe-software-that-i-love\u002F","Series · 36 posts",true,{"title":33,"path":34,"note":25,"series":26},"Navigating the Fog of War: Age of Empires, AI Agents, and the Rise of Dark Code","\u002F2026\u002F05\u002Fnavigating-fog-of-war-age-of-empires-ai\u002F",{"title":36,"path":37,"note":38,"series":26},"The Future of Programming Systems - four thoughts","\u002F2024\u002F09\u002Fthe-future-of-programming-systems-four\u002F","2024",{"title":40,"path":41,"note":38,"series":26},"Always Optimize the Feedback Loop","\u002F2024\u002F07\u002Falways-optimize-feedback-loop\u002F",{"title":43,"path":44,"note":38,"series":26},"\"Security Is Our Top Priority\" is BS","\u002F2024\u002F07\u002Fsecurity-is-our-top-priority-is-bs\u002F",{"title":46,"path":47,"note":48,"series":26},"10x teams","\u002F2025\u002F02\u002F10x-teams\u002F","2025",{"title":50,"path":51,"note":48,"series":26},"Hiring, from the Other Side","\u002F2025\u002F10\u002Fhiring-from-other-side\u002F",1792876809094]