| ▲ | ivanjermakov a day ago | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Zig makes it explicit with
And you would encounter it quite often because unused variable is a compilation error: https://github.com/ziglang/zig/issues/335 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | bluecalm a day ago | parent | next [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Doesn't it make it more likely unused variables stay in the codebase? You want to experiment, the code doesn't compile, you add this (probably by automatic tool), the code now compiles. You're happy with your experiment. As the compiler doesn't complain you commit and junk stays in the code. Isn't it just bad design that makes both experimenting harder and for unused variables to stay in the code in the final version? | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ▲ | ErroneousBosh a day ago | parent | prev [-] | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Golang is exactly the same. It's extremely annoying until it's suddenly very useful and has prevented you doing something unintended. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||