|
|
|
|
|
by jedisct1
552 days ago
|
|
Go refuses variables that are declared and not used as well. And honestly, I like the fact that it forces the source code to not include bloat. Lines of code that are there, but don't do anything, and can be misleading. And in Zig, the language server can be configured to automatically add and remove `_ = variable;` statements, so this is frictionless. |
|
I'm all for preventing this kind of thing from making it into the main branch, but a compiler error by its nature blocks compilation, which forces weird shenanigans like commenting out lines of code or adding arbitrary meaningless uses. Why is that better than a compiler warning (made mandatory in CI)?