What is Data Oriented Design and Why Should You Care?
According to Mike Acton in the talk Data-Oriented Design and C++
Lies:
- Software is the platform
- Code designed around model of the world
- Code is more important than data
Truths:
- Hardware is the platform
- Design around data, not an idealized world
- Your main responsibility is to transform data, not the code design
What can we learn from Mike?
- Understand the Actual Problem: Focus on solving the real-world problem, not an abstract representation. Software is a tool to transform data to solve that problem. The problem dictates the data; the data dictates the code.
- Data First, Then Code: All software is about transforming input data into output data. Understand the data, its structure, its lifecycle, and its transformations before writing code. The code should serve the data, not the other way around.
- Know Thy Hardware: Understand how CPUs, memory, caches, and other hardware components actually work. Design your data structures and algorithms to align with hardware realities for optimal performance. Ignorance of the hardware leads to inefficient software.
- Truth in Data, Truth in Code: The state of your data is the state of your program. Code should directly reflect and operate on this truth. Avoid unnecessary layers of abstraction that obscure the underlying data or its transformations.