Re:Why I Don't Like Golang (2016)
by jeremyjh on Wednesday June 12, 2019 @08:14PM
(#20170694)
This is a solved problem in every compiled language I've ever used - at least 10 of them. Unused variables is a warning, and your CI build compiles with a -werror / --warnings-as-error flag. Thats it. All the benefits you mention, without the "slowing down development" that you mention.
[ Parent
| on HN ]
But people ignore warnings. The only way to keep code clean of unused variables and libraries (and prevent potential bugs where typos led to unused variables) is to disallow it completely.
In the end it's just about the variables anyway, most IDEs will remove unused libraries automatically.