▲ | wavemode 2 days ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
I don't know if I would describe Zig as ergonomic per se. It has some nice features, but the main focus is on completely explicit control over low-level details. In its design Zig always chooses explicitness and programmer control over ergonomics. If a language feature requires a lot of compiler magic then it's probably never going to be added. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
▲ | josephg a day ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Yeah I think of Zig as a modern version of C. And Rust and (I think) D like modern versions of C++. Well. Given D's marriage to the GC, maybe its more like Go or C#. I know its petty - I still can't get past how idiotic and frustrating it is that Zig treats unused variables as a compiler error. Its the worst of all worlds: - Its inconvenient (I have to explicitly suppress them in my code with _ = foo) - Once I've suppressed them, I don't get any compiler warnings any more - so ironically, it takes more effort to find and fix them before committing. I end up accidentally committing code with unused variables more than in Rust or C. - And it totally breaks my flow. I like to explore with my hands and run my code as I go. I clean up my code after my tests pass so I can be sure I don't introduce new bugs while refactoring. Zig's handling of unused variables seems like an unforgivably bad design choice to me. Its been raised by the community plenty of times. Why hasn't it been fixed? I can understand if Andrew Kelly doesn't program the same way I do. We all have our idiosyncrasies. But does he seriously not have any smart people around him who he trusts who can talk him out of this design? It seems like a huge pity to me. It otherwise seems like a lovely language. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|