CHAPTER 6
Enums, Structs, Errors, Unions
Enums, structs, unions, and errors are tools that let us model the world we're building in our programs in a clear and expressive way. With these language constructs, we define our own types - building blocks that help us represent states, structures, and the relationships between them.
In programming, as in life itself, the most serious mistakes often lie in not recognizing failures in time... not knowing how to react to them. Zig has its own way of handling errors. Understanding it is a powerful weapon for creating robust and maintainable software.