Ask HN: How to avoid over-engineering software design for future use cases?
Preface:<p>Once upon a time, I worked for a company who rents movies on DVD via kiosks.  When I joined the team, pricing was <i>hard coded everywhere</i> as a one (1), because YAGNI. The code was not well factored, because iterations and <i>velocity</i>. The UI was poorly constructed via WinForms and the driver code for the custom robotics were housed inside of a black box with a Visual Basic 6 COM component fronting it. It was a TDD shop, and the tests had ossified the code base to the extent that even simple changes were slow and painful.<p>As always happens, the business, wanted <i>more</i>. Different price points! (OMG, you mean it won&#x27;t always be a one (1)!!?) New products (OMG, you mean it won&#x27;t always just be movies on DVD??!) And there were field operational challenges. The folks who stocked and maintained the machines sometimes had to wait for the hardware if it was performing certain kinds of maintenance tasks (customers too). Ideally, the machine would be able to switch between tasks at a hardware level &quot;on the fly&quot;. Oh, and they wanted everything produced <i>faster</i>.<p>I managed to transform this mess. Technically, I would say it was (mostly) a success. Culturally and politically it was a nightmare. I suffered severe burnout afterwards. The lesson I learned is that doing things &quot;right&quot; often has an extremely high price to be paid, which is why it almost never happens.<p>On &quot;over-engineering&quot;:<p>I find this trend fascinating, because I do not believe it to be an inherent issue. Rather, what has happened, is that &quot;engineering&quot; has moved ever closer to &quot;the business&quot;, to the point of being embedded within it. What I mean by &quot;embedding&quot; here is structurally and culturally. [Aa]gile was the spark that started this madness.<p>Why does this matter? Engineering culture is distinct and there are lessons learned within we ought not ignore. However, when a group of engineers is subsumed into a business unit, their ability to operate <i>as engineers</i> with an <i>engineering culture</i> becomes vastly more difficult.<p>The primary lesson I feel we&#x27;re losing in this madness is the distinction between <i>capability enablement</i> and the <i>application of said abilities</i>.<p>Think about hardware engineering: I do not necessarily know all of the ways you -- as the software engineer -- will <i>apply</i> the <i>abilities</i> I expose via my hardware. Look at the amazing things people have discovered about the Commodore 64 <i>years</i> after the hardware ceased production. Now, as Bob Ross would say, &quot;Those are Happy Accidents.&quot; However, if I&#x27;m designing an IC, I need to think in terms of the <i>abilities</i> I expose as fundamental building blocks for the next layer up. Some of those abilities may never be used or rarely used, but it would be short sighted to not include them at all. I&#x27;m going to miss things, that&#x27;s a given. My goal is to cover enough of the operational space of my component so it has a meaningful lifespan; not just one week. (N.B. This in no way implies I believe hardware engineers <i>always</i> produce good components. However, the <i>mindset</i> in play is the important take away.)<p>Obviously, the velocity of change of an IC is low because physics and economics. This leads everyone to assume that <i>all</i> software should be the opposite, but that&#x27;s a flawed understanding. What happens today is we take C#, Java, Python, Ruby, etc. and start implementing business functionality <i>at that level</i>. To stretch my above hardware analogy, this is like we&#x27;re taking a stock CPU&#x2F;MCU off the shelf and writing the business functionality in assembly -- each and every time. Wait! What happened to all that stuff you learned in your CS undergrad!? Why not apply it?<p>The first thing to notice is that the &quot;business requirements&quot; are extremely volatile. Therefore, there must be a part of the system <i>designed</i> around the nature of that change delta.  That part of the system will be at the highest, most abstract, level. Between, say the Java code, and that highest level, will be the &quot;enablement layers&quot; in service of that high velocity layer.<p>Next, notice how a hardware vendor doesn&#x27;t care what you&#x27;ve built on top of their IC component?  Your code, your problem.  Those high-delta business requirements should be <i>decoupled</i> from software engineers. Give <i>the business</i> the tools they need to solve <i>their own</i> problems. This is going to be different for each business problem, but the pattern is always the same. The outcome of this design is that the Java&#x2F;C#&#x2F;whatever code now has a much lower change velocity and the requirements of it are <i>future</i> enablement in service of the tools and abstraction layer you&#x27;ve built <i>for the business</i>. Now <i>they</i> can have one week death march iterations <i>all they want</i>: changing colors, A&#x2F;B testing, moving UI components around for no reason...whatever.<p>There are real-life examples of this pattern: Unity, Unreal Engine Blueprints, SAP, Salesforce. The point here isn&#x27;t about the specifics of any one of these. Yes, a system like Blueprints has limits, but it&#x27;s still impressive.  We can argue that Unity is a crappy tool (poor implementation) but that doesn&#x27;t invalidate the pattern. SAP suffers from age but the pattern is solid. The realization here is that the tool(s) for <i>your</i> business can be tailored and optimized for their specific use case.<p><i>Final thoughts</i><p>Never underestimate that the C3 project (where Extreme Programming was born) was written in Smalltalk, with a Gemstone database (persistent Smalltalk). One of the amazing traits of Smalltalk is that the <i>entire environment</i> itself is written in Smalltalk. Producing a system like I describe above, in Smalltalk, is so trivial one <i>would not notice it</i>. Unfortunately, most business applications are not written in environments nearly as flexible so the pattern is obscured. I&#x27;ve held the opinion for a long time that XP &quot;worked&quot; because of the skills of the individual team members <i>and</i> the unique development environment in use.<p>As I stated at the beginning, this path is fraught with heartache and dragons for human reasons.