3 ms·
You're not alone. Fridays are my live streaming day and I've chosen today's topic to be the user experience of unused variable errors. I have an idea to solve
by AndyKelley 4y ago
You're not alone.
Fridays are my live streaming day and I've chosen today's topic to be the user experience of unused variable errors. I have an idea to solve this that can satisfy both parties - those who don't want to be bothered by such errors, and those who want the premise upheld that if Zig code compiles, it does not have any unused variables.
In approximately 60 minutes I'll go live on https://www.twitch.tv/andrewrok/ https://www.twitch.tv/andrewrok/
- TakeBlaster16 4y agoNice to see you here. I'm not much of a twitch guy, but I'm glad this is on your radar and I'll read about it afterwards! If you're talking about the `zig fmt` idea, I'd like to draw your attention to a possible pitfall -- Silencing the errors with _ increases the risk that unused vars will be committed to the repo. https://news.ycombinator.com/item?id=32753079 https://news.ycombinator.com/item?id=32753079 I normally add the equivalent of `-Werror` to pre-commit and CI. But if those warnings are silenced directly in the source code, I can no longer rely on the compiler's guidance to clean up the code, and I would have to hope I could remember all the places I need to clean up before committing. In that way, solving this in the formatter could have the opposite effect on code quality than you intended. I _do_ want the compiler to yell at me... just not yet. Only when it comes time to commit. Overall I've been impressed reading about Zig's design. You clearly have good engineering taste and I respect you challenging the status quo and trying unconventional ideas, even if I may disagree from time to time. I'm itching to start using the language once this is solved!