this post was submitted on 19 Sep 2025
550 points (99.5% liked)

Programmer Humor

27444 readers
1983 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 21 comments
sorted by: hot top controversial new old
[–] relativestranger@feddit.nl 36 points 2 months ago

they all do, if each square is considered separately.

[–] DScratch@sh.itjust.works 28 points 2 months ago (1 children)

PirateSoftware is making CAPTCHAS now?

[–] Gonzako@lemmy.world 16 points 2 months ago

I think this is just ofuscated code from one of the npm supply chain attacks

[–] scrubbles@poptalk.scrubbles.tech 23 points 2 months ago

If there are none, press "Ship"

[–] AmidFuror@fedia.io 21 points 2 months ago

Ironically, this is something AI should be very good at detecting.

[–] ripcord@lemmy.world 18 points 2 months ago (1 children)

This code makes me really unhappy

Although I am really desensitized right now. Earlier today I had to review a PR for that guy that maintains that one project that has things like 8000-line functions of mostly nested ifs. And they won't let me reject them anymore with "BURN IT. BURN IT ALL"

[–] mere@lemmy.blahaj.zone 13 points 2 months ago (1 children)

it's de-obfuscated, a human didn't write it (in that form) thankfully

[–] Tja@programming.dev 10 points 2 months ago* (last edited 2 months ago) (1 children)

Disassembled. Still pretty obfuscated.

EDIT: on a close look this is not C, so not disassembled, just obfuscated.

[–] mere@lemmy.blahaj.zone 2 points 2 months ago

oops yeah brain fart sorry

[–] Freigeist@lemmy.world 14 points 2 months ago (1 children)
[–] treesquid@lemmy.world 1 points 2 months ago (1 children)
[–] Freigeist@lemmy.world 1 points 2 months ago

Pull request reviews

[–] cows_are_underrated@feddit.org 6 points 2 months ago (1 children)

What the hell is that code even meant to do?

[–] ArsonButCute@lemmy.dbzer0.com 15 points 2 months ago

So there's some data its concatenating from some lists and running some checks on. If one if the checks succeeds it runs a function called clearInfo, I don't know js so idk if that's a built-in or if they defined it elsewhere in the script. If that check fails it runs clearInterval. This is all wrapped in a function called setInterval, and it looks like if all the checks succeed and the interpreter isn't moved to a different section of code by those functions called earlier then it will set whatever this interval is to 10000, presumably milliseconds. That's the big block in the middle.

The top block calls some code referencing a document, which appears to be stored as a list, index 12 is referenced and another obfuscated argument is applied to it.

The bottom block appears to be defining a function that will interact with the document referenced above. Calling the function showInfo and presumably concatenating and formatting some data into a pretty output for a user to get info regarding the document being referenced.

Someone who actually knows js could probably tell you more, I know python and c++ and this looks kinda like python but the syntax is a bit different so I could be way off

[–] danc4498@lemmy.world 3 points 2 months ago

Is this how AI actually helps me complete my code?

[–] CXORA@aussie.zone 3 points 2 months ago

clearInterval needs an argument, so we need to be storing the interval we created with the setInterval call.

[–] pewpew@feddit.it 2 points 2 months ago

What the hell is this 😭

[–] rikudou@lemmings.world 2 points 2 months ago

LGTM, approved.

[–] stupidcasey@lemmy.world 2 points 2 months ago
[–] humanspiral@lemmy.ca 1 points 2 months ago (1 children)

can't tell if C or Javascript. Could this be meta that all squares of javascript are always all buggy?

[–] irelephant@lemmy.dbzer0.com 6 points 2 months ago

C doesn't have the function keyword