How terrible code gets written by sane people
It feels like people are focusing on bad conditions and unreasonable deadlines, and not the idea that in the real world smart people under execellent conditions do this very, very frequently.<p>I&#x27;ve worked for long periods of time in 3 codebases that were over 2 million loc in my career, all had great conditions, all had very smart people. Those are not huge codebases by any standard, and yet all 3 had people talking about ground up rewrites. All 3 had people complaining about every single example the author used. Two of them undertook the ground up rewrite estimating one year. Both admitted to having made a huge mistake 3-5 years later.<p>My theory is that <i>all</i> software eventually becomes difficult to maintain and full of warts, regardless of smartness, regardless of conditions. We all have code ideals we believe and talk about that don&#x27;t work as well in the real world as we imagined. We all have deadlines that are shorter than we want -- it&#x27;s a universal constant. We all imagine we can write code and fix big problems faster than we really can. And we all fail to fully understand what&#x27;s working right in a messy large codebase and tend to focus on what&#x27;s wrong.<p>I don&#x27;t know how to fix this, but it&#x27;s very possible the author ran into thoughtful paradigms he just hadn&#x27;t seen before and didn&#x27;t fully understand. Some styles seem messy if you haven&#x27;t seen them before.<p>React is an intentional lack of separation of concerns between code and markup. Some projects are <i>required</i> to mix tabs and spaces depending on tools. For that matter, bash scripts alone require mixing tabs and spaces for some features. And so on, it&#x27;s important to have context for why things are the way they are before jumping to the conclusion that it&#x27;s bad.