this post was submitted on 05 Jun 2025
221 points (98.3% liked)

Programmer Humor

23861 readers
3189 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
 
top 36 comments
sorted by: hot top controversial new old
[–] savvywolf@pawb.social 50 points 2 days ago (1 children)

Hot take: Clean up your darn imports. Otherwise you just make the links between modules confusing and messy.

[–] jadelord@discuss.tchncs.de 13 points 2 days ago (1 children)

Sounds like a perfectly normal take.

[–] CanadaPlus@lemmy.sdf.org 9 points 1 day ago (1 children)

Really, OP might have had the hot one with "unnecessary imports sitting around is fine".

[–] shynoise@lemmy.world 3 points 1 day ago

...if only that were the case.

[–] masterspace@lemmy.ca 62 points 2 days ago (2 children)

We have linting set up in our codebase, I had to switch and focus on one half of our project, and I nearly lost my mind when I came back to the other side and realized that every time someone said they were 'addressing linting issues', that actually meant they were putting eslint-disable everywhere until the pipeline stopped complaining.

[–] ryannathans@aussie.zone 25 points 2 days ago (2 children)
[–] CameronDev@programming.dev 24 points 2 days ago (1 children)
[–] mad_lentil@lemmy.ca 7 points 2 days ago (1 children)
[–] CameronDev@programming.dev 13 points 2 days ago (3 children)

Move over vibe coding, we vibe reviewing now

[–] ulterno@programming.dev 3 points 1 day ago* (last edited 1 day ago) (1 children)

Next what?
Vibe marketing?
Then vibe selling and vibe buying?
Then vibe using? Because software is now made out of AI, by AI, for AI?

So now, if your AI user likes the program that your AI buyer bought, it will inject some dopamine in your bloodstream, giving you the vibes, while you lay on your bed?

[–] BootLoop@sh.itjust.works 2 points 2 days ago* (last edited 2 days ago)

Copilot does do reviews in Github now. And they're decent actually, in my experience.

[–] mx_smith@lemmy.world 1 points 1 day ago

Yeah code rabbit does a decent job of pointing out things you may have missed.

[–] masterspace@lemmy.ca 9 points 2 days ago* (last edited 2 days ago)

The developer I report to was in charge of that side of the code base and doing all the code reviews for it .... I thought he had a handle on it :/

[–] magikmw@lemm.ee 5 points 2 days ago

I might get physical in that sitiation. And I'm very tame.

[–] CanadaPlus@lemmy.sdf.org 18 points 2 days ago (2 children)

The duality of Programmer Humor: You get posts complaining about bloat, and posts complaining about this.

[–] katze@lemmy.cafe 4 points 2 days ago (1 children)

Competent people vs incompetent people.

[–] ulterno@programming.dev 0 points 1 day ago

Also, slightly less competent ppl vs slightly more competent ppl.

[–] Quetzalcutlass@lemmy.world 6 points 2 days ago (5 children)

Except those imports were used by a huge section of code you temporarily commented out, and now you'll need to manually select a dozen imports to get it working again when you come back to it.

(Sure you could have just commented out the unused imports, but the linter auto-sorted them and you're feeling too lazy to copy-paste a dozen scattered lines)

[–] blaue_Fledermaus@mstdn.io 32 points 2 days ago (1 children)

That is what version control is for.

[–] entropicdrift@lemmy.sdf.org 22 points 2 days ago (2 children)

This. Commenting out code is bad practice

[–] ulterno@programming.dev 1 points 1 day ago* (last edited 1 day ago)

Yeah, I stopped using comments as a code ON/OFF switch when I started using git.
But then I handed over my project to someone without OCD and now the repo is full of code inside comments.


And because I don't use git stash properly enough, in some projects, my stash is 3+ stacks long, with almost the same changes in each of the stashed entries.

[–] naeap@sopuli.xyz 2 points 2 days ago (1 children)

In general, I'm with you
But sometimes I need to revert/comment out a code block, because another code part isn't finished/working as it should.
Sure, it clutters code, but if I just comment out a function call and temporarily replace it with the workaround, it should imho stay in code.

Else the workaround will stay forever and the commented out code will act as a reminder, that this part isn't clean yet.

But maybe it really is a case by case thing, where sometimes it's better to branch it out for later merge - although that can get really messy, while having the future implementation commented out, others will also see, how it is supposed to work and don't try to further extend the workaround, which makes future merging hell

Out of interest, how would your best practice look in such cases?

[–] entropicdrift@lemmy.sdf.org 4 points 2 days ago* (last edited 2 days ago)

I would make it a TODO so that it's clearly temporary and so the linter bugs me about it until the intended permanent code is restored.

In general I prefer to keep separate branches and maybe a draft PR open for visibility for that kind of situation, though.

[–] CameronDev@programming.dev 13 points 2 days ago (1 children)

Use a good IDE, and readding the imports is pretty easy.

I find commented code to be a bit of a smell on its own, just delete it, and if you really need it again, dig it out of source control.

[–] jjjalljs@ttrpg.network 10 points 2 days ago

Yeah. My last job, a PR with commented out code typically wouldn't get approved. Either leave it in version history, or stick it on a branch

[–] mmddmm@lemm.ee 6 points 2 days ago (1 children)

Hum... Ignore linter advice for code that you temporarily mangled.

It's not like you have to act upon it as soon as a blue line appears under your code.

[–] bleistift2@sopuli.xyz 0 points 2 days ago (1 children)

Depending on the configuration, a linter may cause the compilation or a CI pipeline to fail.

[–] mmddmm@lemm.ee 1 points 2 days ago (1 children)

Failing your local compilation due to linter problems is just stupid.

Sending "temporary" changes into your CI pipeline isn't even stupid, it's borderline malicious.

[–] bleistift2@sopuli.xyz 1 points 2 days ago

Sending “temporary” changes into your CI pipeline isn’t even stupid, it’s borderline malicious.

No? “Hey customer, I’ve deployed the changes you requested to the staging area. Is this what you had in mind? Keep in mind it only looks good and isn’t fully functional yet.”

[–] thequickben@lemm.ee 3 points 2 days ago

During code review, we reject PR’s with commented out code. Problem solved.

[–] CaptDust@sh.itjust.works 2 points 2 days ago (1 children)

Honestly I'll disable linting across entire files during these kinds of refactors because it's annoying having build output littered with unused imports and format warnings while I'm still working on a solution. Requires some extra diligence to re-enable and clean up before pushing though.

[–] zqwzzle@lemmy.ca 2 points 2 days ago

Use pre-commit with a linter config that checks all files, local dev can have a different config to disable as needed.

[–] ulterno@programming.dev 0 points 1 day ago
  • Case 1:
    • Just typed the ending '>' for the include and see the annotation come up.
  • Case 2:
    • Did not include the header, so not getting the code completion recommendation, making me have to type the function/class/whatever name.
  • Case 3:
    • The code completion comes up with an option of including the header (except that it is including the wrong header, despite me having already included the correct one)

The Trade Federation greatly appreciates useful imports.