Back to course

The Zig Zen

Full Course: Zig Programming From Zero to Hero

The Zen of Zig

Zig has a philosophy that guides its design. Understanding these rules helps you write better Zig code.

  • Communicate intent precisely.
  • Edge cases matter.
  • Only one obvious way to do things.
  • Runtime crashes are better than bugs.
  • Compile-time is better than runtime.

Zig avoids the 'magic' found in other languages. There are no macros, no preprocessors, and no hidden memory allocations.