Hot take: Clean up your darn imports. Otherwise you just make the links between modules confusing and messy.
Sounds like a perfectly normal take.
Really, OP might have had the hot one with “unnecessary imports sitting around are fine”.
…if only that were the case.
The duality of Programmer Humor: You get posts complaining about bloat, and posts complaining about this.
Competent people vs incompetent people.
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.Code reviews?
“It passed CI, LGTM”
My eye just twitched
Move over vibe coding, we vibe reviewing now
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?
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)
That is what version control is for.
This. Commenting out code is bad practice
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?