Lie 2: Code Should Be Designed Around a Model of the World

“Solving problems you probably don’t have creates problems you definitely do.” – Mike Acton (2014 - CppCon)

Truth: Code should be designed around the data, not some idealized model.

World modeling is a common approach in programming that involves trying to solve problems by drawing analogies or telling stories, rather than using more concrete, engineering-based methods. While this approach may seem appealing at first, it often leads to problems that are harder to understand and maintain in the long run. This is because world modeling involves hiding data and trying to simplify the complexity of the problem by idealizing it. This can result in large, monolithic data structures and transformations that are disconnected from the reality of the problem.

In contrast, engineering approaches to problem-solving in programming focus on the concrete realities of data transformations, rather than trying to solve problems through analogy or story telling. These approaches are typically more reliable and accurate because they involve a deeper understanding of the data and the problem at hand. By working with the actual data transformations involved, rather than trying to simplify or abstract them away, engineers can build solutions that are more robust and adaptable to changing conditions. Ultimately, the choice between world modeling and engineering approaches to problem-solving in programming comes down to a trade-off between ease of maintenance and understanding the data and the problem. While world modeling may offer slightly easier maintenance in some cases, it comes at the cost of a deeper understanding of the problem and the data being used.