this post was submitted on 14 Aug 2023
1426 points (98.0% liked)
Programmer Humor
19512 readers
314 users here now
Welcome to Programmer Humor!
This is a place where you can post jokes, memes, humor, etc. related to programming!
For sharing awful code theres also Programming Horror.
Rules
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
As your future colleague wondering what the hell that variable is for, thanks Go.
If only there was some way the compiler could detect unused variable declarations, and may be emit some sort of "warning", which would be sort of like an "error", but wouldn't cause the build to fail, and could be treated as an error in CI pipelines
Some people simply ignore warnings, that's the main issue. Trust me, I saw this way too often.
If you cannot compile it than you have to fix it, otherwise just mark unused variables as 'not an error' via
_ = someunusedvar
.