this post was submitted on 14 Aug 2023
1321 points (98.0% liked)

Programmer Humor

23783 readers
2568 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

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] DarkDarkHouse@lemmy.sdf.org 191 points 2 years ago (15 children)

As your future colleague wondering what the hell that variable is for, thanks Go.

[–] ennemi@hexbear.net 18 points 2 years ago* (last edited 2 years ago) (3 children)

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

[–] iammike@programming.dev 3 points 2 years ago

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.

load more comments (2 replies)
load more comments (13 replies)