← Back to context

Comment by lukaslalinsky

4 hours ago

The main advantage of Zig for me and many other programmers, is the simple mental model you need to keep while reading the code. All control flow is expressed by keywords, never symbols. That along makes code much more readable. There is nothing like Rust macros, things can't do "magic. Zig comptime are regular functions, so you can clearly see and follow the trail. There are no exceptions, no recoverable panics, all code will run linearly as you see it written. Error handling in Zig is close to perfect, in my view. Obviously, Zig is not a language to use for high-level jobs. It makes no sense to write CRUD web app in Zig, you will be fighting the resource management for no good reason. For me personally, I feel that I'm too stupid to use Rust effectively. I started moving away from C++ purely because I don't want to deal with exceptions. And Rust is just a more complex C++ with memory safety.