The Big Oops in Type Systems: This Problem Extends to FP as Well Building on Casey Muratori's critique (youtube) of "compile time hierarchies that match the domain model," this problem extends beyond OOP to encompass a broader pattern in static type systems, particularly functional programming approaches that attempt to "make illegal states unrepresentable." Type systems are often ranked in a "correctness hierarchy", with Idris/Haskell at the top, Java/C# in the middle, Python/JavaScript at the bottom. Static type proponents argue that better type systems can capture domain models more accurately, reducing the need for tests by proving certain software properties impossible. The experiment of encoding complex business domains directly into mathematical type constructs has shown mixed results, succeeding in some areas while struggling with the inherent messiness of business logic. While functional programming concepts have spread to other languages, they've largely abandoned the rigid philosophy that defines languages like Haskell. Technical Models vs. Domain Reality There's a critical distinction between technical understanding (how data is processed) and domain presentation (how data is conceptualized within the problem domain). Data processing works best when mapped onto "simpler" reasoning models (à la Rich Hickey's "simple not easy") and then transformed. But domain presentation must accommodate legacy and entrenched domain understanding that evolves with business requirements. The trap is that both OOP hierarchies and FP "make illegal states unrepresentable" create premature crystallization of domain understanding into rigid technical models. When domains evolve (and they always do), this coupling demands expensive refactoring. It's fascinating that an industry that learned the pitfalls of premature optimization and tight coupling has convinced itself that encoding domains into type systems is beneficial—despite creating these very same problems. The Categorica...
First seen: 2025-08-02 20:15
Last seen: 2025-08-03 00:16