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

Programmer Humor

19721 readers
78 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 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 196 points 1 year ago (15 children)

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

[–] [email protected] 22 points 1 year ago* (last edited 1 year 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 3 points 1 year 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)