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

Programmer Humor

26450 readers
1092 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
 
you are viewing a single comment's thread
view the rest of the comments
[–] cows_are_underrated@feddit.org 7 points 1 day ago (2 children)

What the hell is that code even meant to do?

[–] ArsonButCute@lemmy.dbzer0.com 16 points 1 day ago (1 children)

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

[–] SubArcticTundra@lemmy.ml 10 points 1 day ago (1 children)

If you were reading it as python with c++ syntax, you'd be right. Also you have too much free time.

[–] ArsonButCute@lemmy.dbzer0.com 6 points 1 day ago (1 children)

I do have way too much free time, that's why I'm in school to get the piece of paper that says I know programming so I can get a job god I'm so bored being unemployed sucks

[–] SubArcticTundra@lemmy.ml 2 points 14 hours ago* (last edited 14 hours ago) (1 children)

I'm in school to get the piece of paper that says I know programming so I can get a job

Same here homie! Cheers! 🥂

You might want to try taking part in some competitions/hackathons. I've been doing it in an attempt to put my free time to good use and it helps you gain industry connections. Plus you get to try out various fields of application so you find out what you'd potentially enjoy.

[–] ArsonButCute@lemmy.dbzer0.com 2 points 14 hours ago

That's a great idea, I've got some hacker/programmer buddies who go to defcon and ziacon every year so I'm gonna try to go next year to make connections in the field too. Missed them this year and I was super upset, I've been wanting to hit defcon since I was a freshman in high-school, some decade and a half ago

[–] Ephera@lemmy.ml 5 points 1 day ago

This isn't supposed to be readable code, by the way.