▲ | josephg a day ago | |||||||||||||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||||||||||||||
▲ | WalterBright an hour ago | parent | next [-] | |||||||||||||||||||||||||||||||||||||
D will complain about unreachable code. I'm not a big fan of that, as it makes it a pain for me when doing a binary search looking for the source of a problem. | ||||||||||||||||||||||||||||||||||||||
▲ | WalterBright an hour ago | parent | prev | next [-] | |||||||||||||||||||||||||||||||||||||
D's use of GC is more like a friend than a marriage. | ||||||||||||||||||||||||||||||||||||||
▲ | kristoff_it a day ago | parent | prev [-] | |||||||||||||||||||||||||||||||||||||
> 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? Because yours is just an opinion. It's perfectly legitimate to not like unused variable errors, but its factually wrong to say that no one wants it. You're just yucking somebody else's yum. > But does he seriously not have any smart people around him who he trusts who can talk him out of this design? He does, most of them also like unused variable errors. For what it's worth, I do too. | ||||||||||||||||||||||||||||||||||||||
|