this post was submitted on 14 Aug 2023
39 points (100.0% liked)

Programmer Humor

19149 readers
1184 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
[–] CodeBlooded@programming.dev 0 points 1 year ago* (last edited 1 year ago) (20 children)

If this language feature is annoying to you, you are the problem. You 👏are 👏 the 👏 reason 👏 it 👏 exists.

I worked in places where the developers loaded their code full of unused variables and dead code. It costs a lot of time reasoning about it during pull request and it costs a lot of time arguing with coworkers who swear that they’re going to need that code in there next week (they never need that code).

This is a very attractive feature for a programming language in my opinion.

PS: I’m still denying your pull request if you try to comment the code instead.

❗️EDIT: A lot of y’all have never been to programming hell and it shows. 🪖 I’m telling you, I’ve fixed bayonets in the trenches of dynamically typed Python, I’ve braved the rice paddies of CICD YAML mines, I’ve queried alongside SQL Team Six; I’ve seen things in production, things you’ll probably never see… things you should never see. It’s easy to be against an opinionated compiler having such a feature, but when you watch a prod deployment blow up on a Friday afternoon without an easy option to rollback AND hours later you find the bug after you were stalled by dead code, it changes you. Then… then you start to appreciate opinionated features like this one. 🫡

[–] m_f@midwest.social 3 points 1 year ago (7 children)

That's 👏 what 👏 CI 👏 is 👏 for

Warn in dev, enforce stuff like this in CI and block PRs that don't pass. Go is just being silly here, which is not surprising given that Rob Pike said

Syntax highlighting is juvenile. When I was a child, I was taught arithmetic using colored rods. I grew up and today I use monochromatic numerals.

The Go developers need to get over themselves.

[–] flumph@programming.dev 0 points 1 year ago (3 children)

What's a situation where you need an unused variable? I'm onboard with go and goland being a bit aggressive with this type of thing, but I can't think of the case where I need to be able to commit an unused variable.

[–] hare_ware@pawb.social 1 points 1 year ago

I will need it two minutes tops. If I don't use it by then, I'll delete it, especially if it gives a warning like Rust does. But this? It just gets in the way.

load more comments (2 replies)
load more comments (5 replies)
load more comments (17 replies)