The junior doesn’t know that these aren’t unused functions. They’re load bearing functions.
I am God's greatest programmer
Submitted 1 year ago by bigboismith@lemmy.world to programmer_humor@programming.dev
https://lemmy.world/pictrs/image/458e39ee-9f11-4346-9904-d1a5cf317205.jpeg
Comments
MamboGator@lemmy.world 1 year ago
sbv@sh.itjust.works 1 year ago
Neither does the senior
Killing_Spark@feddit.de 1 year ago
Anymore
bappity@lemmy.world 1 year ago
me when first starting out at a company commenting everything I can VS me a couple years in completely lost because I never updated the comments and now none of them make any sense
xmunk@sh.itjust.works 1 year ago
Commenting well is a highly advanced skill. I generally prefer no comments on code since it’s less likely to confuse people and I’ll merrily purge auto-doc comments and anything like
// getId() returns an id
That comment has negative value.
kubica@kbin.social 1 year ago
I can't help it, I always get the mental image of hands clapping sarcastically when I see something like that.
platypode@sh.itjust.works 1 year ago
In my experience refactoring lots and lots of crappy code left by devs long gone, a dev who can write useful comments is by and large a dev who can write code clean and simple enough not to need them. If the code doesn’t have informative names and clear separation of concern, chances are a comment won’t help because the dev didn’t really know what they did that worked in the first place.
magic_lobster_party@kbin.social 1 year ago
Comments should only be used to describe stuff that’s otherwise difficult to convey with code.
bear@slrpnk.net 1 year ago
I write a lot of fairly simple scripts in Bash and PowerShell that should be easily understood by anybody else with moderate experience in the language, but I leave a lot of obvious comments because my coworkers don’t write any code and are extremely skittish about my automations. I add them basically to quell their fears.
oce@jlai.lu 1 year ago
I’d rather teach people to comment well through my reviews. Much easier to understand two lines of well written function description in English than 20 lines of code.
Landless2029@lemmy.world 1 year ago
Yeah well now we have git copilot where your comments include AI suggestions.
Now I have TONS more comments
magic_lobster_party@kbin.social 1 year ago
There’s also that long time senior dev who’s overly confident in their abilities and force pushes production breaking code directly to master.
jelloeater85@lemmy.world 1 year ago
Yeet that shit into main. Who needs unit tests, it works on my computer?
magic_lobster_party@kbin.social 1 year ago
If it works in my mind it’s ready for production
wizardbeard@lemmy.dbzer0.com 1 year ago
YOLOdev is the best way to dev
Strawberry@lemmy.blahaj.zone 1 year ago
This shit happened the other week for me. Senior dev pushed the shittiest JS code without testing the day of a production install and it caused us to have to roll back the install after it very predictably caused a bunch of crashes for pages on our public site. Worst part is, the entirety of what he wrote could’ve been implemented as a CSS media query
pennomi@lemmy.world 1 year ago
The leash is good unit testing.
ericbomb@lemmy.world 1 year ago
Look, it’s me.
Just let me rewrite ONE report from scratch so it doesn’t check a specific unindexed table that it doesn’t actually need to check and causes the report to be killed by MSQL because it takes too long to run.
Please just one rewrite. Please.
Just one little crystal report.
southsamurai@sh.itjust.works 1 year ago
Why is the junior dev tied to the other one’s penis?
ButtCheekOnAStick@lemmy.world 1 year ago
Because everyone sucks at drawing hands
ryan@the.coolest.zone 1 year ago
Let him play in the legacy code. You can just hose him off later before letting him back into the office so he doesn't track it everywhere.
ISometimesAdmin@the.coolest.zone 1 year ago
Unfortunately if you let Junior play in legacy code once, it'll learn some nasty habits and make more of it from scratch, usually when you're trying to sleep.
Hazzia@discuss.tchncs.de 1 year ago
It’s true, spaghettification sauce stains clothes. Best keep Jr out of it entirely.
MonkderZweite@feddit.ch 1 year ago
That’s what the line represents. So they can pull you if do something nasty.
BaardFigur@lemmy.world 1 year ago
How do you even fix it, when the design is broken. Sure you can make an alternative function, without all the warts, but how do you convince the “seniors” to not use the old functions, because it is in fact problematic for various reasons.
We have a separate C-library that returns all strings by ringbuffer. Why is that a problem? Call into the ringbuffer enough times, and it will wrap around, overwriting earlier strings. This, and other bad code practices such as broken multi-threaded code (not threadsafe), and more.
CodeMonkey@programming.dev 1 year ago
If you are creating an alternative implementation and leaving the old one in place, you are not fixing a problem, you are just creating a new one (and a third one because you have duplication of logic).
Either refactor the old function so that it transparently calls the new logic or delete the old function and replace all the existing usage with usage of the new one. It does not need to happen as a single commit. You can check in the new function, tell everyone to use it, and clean up usage of the old one. If anyone tries to use the old implementation, call them out in a code review.
If removing or replacing the old implementation is not possible, at least mark it as deprecated so that anyone using it gets a warning.
mbp@lemmy.sdf.org 1 year ago
God, I would love that so much