this post was submitted on 24 May 2024
299 points (98.4% liked)

Programmer Humor

32503 readers
403 users here now

Post funny things about programming here! (Or just rant about your favourite programming language.)

Rules:

founded 5 years ago
MODERATORS
 
top 24 comments
sorted by: hot top controversial new old
[–] tills13@lemmy.world 48 points 5 months ago (2 children)

It's an internal inside of React.

[–] neclimdul@lemmy.world 5 points 5 months ago

So using react will get you fired? I knew it!

[–] xmunk@sh.itjust.works 46 points 5 months ago (1 children)

What an absolutely shitty peppering string.

[–] Peter_Arbeitslos@discuss.tchncs.de 58 points 5 months ago (2 children)

The code file has 32.171 lines, at least after beautifing it. 1MB fucking js code.

[–] mynachmadarch@kbin.social 36 points 5 months ago (2 children)

And this is why I hate all web development and the fact that most jobs are web bs these days. Everything has so much crud baked in and including twelve modules with a million functions just to do anything is the norm.

Giving my back my beautiful optimized assembly dangit.

[–] jcg@halubilo.social 14 points 5 months ago (1 children)

We have to work under the assumption that most development is done by inexperienced or, to put it bluntly, bad programmers. I would MUCH rather have bad JS code than bad assembly. One may crash a single tab in my browser, the other may crash my entire computer.

[–] FarceOfWill@infosec.pub 2 points 5 months ago (1 children)

Unless you're using js in your hardware drivers it's very unlikely to bring down the entire computer

But with the state of software development maybe you are /o\

[–] Halosheep@lemm.ee 4 points 5 months ago

Dude what? The other guy implied that bad JS would kill a browser tab, not your computer.

[–] Luccus@feddit.de 7 points 5 months ago

Me: Can I have (small template parser)?

Stackoverflow: No, we have (small template parser) at home.

Small template parser at home: Full-stack web framework

[–] joyjoy@lemm.ee 5 points 5 months ago

Don't worry, this file is likely the output of a bundler.

[–] morrowind@lemmy.ml 24 points 5 months ago (2 children)

What am I looking at here?

[–] ImplyingImplications@lemmy.ca 56 points 5 months ago (1 children)

There's a string stating that the code should not be passed or the employee will be fired. I'd assume this was a test to see if an employee meant to be doing code review was actually doing them. Spoiler, they were not, as OP said they found this in production code.

[–] xmunk@sh.itjust.works 13 points 5 months ago (2 children)

I'd go a step further and I suspect it's a peppering string (i.e. fixed string you add to hashes to defeat rainbow tables). I'd really hope it isn't as you mentioned because gosh that sounds like a toxic workplace if someone is just leaving landmines around purely to get someone fired.

[–] skulblaka@startrek.website 19 points 5 months ago (1 children)

More like, you know damn well that Jim keeps passing code reviews without reading a line in them, he's been talked to, still does it, and you need something actionable to prove it so that you can get someone's ass in his chair who does their job.

[–] jcg@halubilo.social 12 points 5 months ago

From the stories I've heard from corporate software employees, this does sound like exactly the kind of thing you gotta do to show some manager the guy is buddy-buddy with that they're actually not doing their job. And even then they didn't listen.

[–] Reddfugee42@lemmy.world -1 points 5 months ago* (last edited 5 months ago) (1 children)

Would that imply that all quality control is evil?

[–] xmunk@sh.itjust.works 1 points 5 months ago (1 children)

No, I don't think so - it's just a dick move to go out of your way to sabotage someone. If they're fucking up just visit their existing mistakes - don't waste time contriving new ones.

[–] Reddfugee42@lemmy.world 1 points 5 months ago

So when TSA sends fake guns and bombs through luggage, it's not qa, it's just a dick move to sabotage them?

[–] palordrolap@kbin.social -1 points 5 months ago (1 children)

My guess is a "solution" to the age-old problem of needing to store a secret in a file that the user can download, thus making the entire system insecure.

This "solution" appears to be either that the string itself is so outrageous that the user would not believe that it's the real secret when it is in fact the real secret, leveraging security through obscurity, or else it's there in place of the real secret that cannot be revealed under pain of ~~death~~ firing, and therefore is accidentally being used instead of that intended secret... so it's not secret after all.

Unless they're doing something incredibly clever to substitute that secret string for the real thing when the time is right and doing it in such a way that the user can't intercept, someone's getting fired.

[–] dev_null@lemmy.ml 5 points 5 months ago

No, it's not. It's part of React internals that you shouldn't use because your app will break. It's a warning for developers using React. It's not a secret of any kind.

[–] AdamEatsAss@lemmy.world 13 points 5 months ago

I bet the guy who said "looks good to me" still has a job too.

[–] winterayars@sh.itjust.works 12 points 5 months ago

You should really be using a pre commit hook to catch secrets. Admittedly it may not have caught this, but manual review is (clearly) not always sufficient.

[–] dean@beehaw.org 11 points 5 months ago