8 ms·
Honestly, most everything listed on the page as an advantage of Zig, is a disadvantage from my point of view. I'm sure Zig has its use cases. For what I write,
by SomeCallMeTim 3y ago
Honestly, most everything listed on the page as an advantage of Zig, is a disadvantage from my point of view.
I'm sure Zig has its use cases. For what I write, I not only don't care if there's a hidden function call or error handling, I see those as 100% necessary for a modern language.
Needing to handle errors inline is a huge mess for anything nontrivial. It distracts from the logic that's important at that point in the code. Being able to override an accessor to do something instead of being a raw access is incredibly useful; a tiny change and rebuild is all that's required to track information that you would otherwise need to rewrite an entire app to support.
If you're writing extremely low level code and libraries, especially embedded, then fine, minimizing hidden behavior is important. Being able to operate without a standard library is also important in that case. Outside of that niche, though, there are few places I'd call those "features" of Zig an advantage.
- throwawaymaths 3y ago> Needing to handle errors inline is a huge mess for anything nontrivial Maybe try zig first before you make such a blanket statement?
- anonymoushn 3y agoZig's error handling is unobtrusive. You can just write `try` if you want to propagate errors instead of handling them in some specific way.
- EasyMark 3y agoYeah zig just doesn't offer enough advantages over "I'll just use c++ as a better c with raii, containers, safe string class, template functions, and very simple classes/powerful structs (no inheritance), and a threading standard library"