|
|
|
|
|
by masklinn
1381 days ago
|
|
> I’d assume they care because Go was designed to keep the codebase as “neat” and clean as possible when being worked on by many developers So someone’s anal retentive was made into a langage mandate rather than anything actually useful? > Given enough time and developers, things like unused variables will start to seep in and make the codebase dirtier. Why are dead variables any dirtier than dead stores? Or unchecked errors? |
|
If you mean stores to fresh local variables, I assume that should also count in a proper/ideal implementation of this.
If the idea is for code to be literally WYSISWYG, then your compiler will no longer eliminate variables or code for you, so you have to do it.
In principle, a dead variable in final code is also almost certainly a mistake: either by not including the variable in the computation or for declaring the variable at all. Maybe a little annoying while you're figuring something out, but makes sense in the context of polished code.