Chapter summary
Showing text on the screen is simple in Zig thanks to the print function from std.debug. This function takes a string and a tuple (which can be empty) as arguments.
- We use constants for values that won't change during the program's execution.
- Variables are only used when we need to modify values after they’ve been set.
- In Zig, the most basic data types are unsigned and signed numbers (which can be integers or floating-point and come in varying bit widths), tuples, booleans, and other types like void and type, which we'll discuss in later chapters.
- Escape sequences let us insert special characters, such as newlines.
- Comments are useful for explaining the code. Also, we can highlight something unusual or mark parts that are still a work in progress.
- When using function aliases we write less code by shortening repeated paths.