this post was submitted on 13 Dec 2025
648 points (97.6% liked)

Programmer Humor

28009 readers
1252 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
[โ€“] edinbruh@feddit.it 1 points 1 week ago (1 children)

Please don't do that, I was stupid when I wrote that. But still, in very dynamic languages like python or js everything is an object, including functions, so you can just do object stuff on them.

[โ€“] squaresinger@lemmy.world 1 points 1 week ago

I wasn't going to, and after I saw it it totally makes sense that it's possible, it just never occurred to me.

I guess this could be used like static variables inside functions in c. So scope-limited global variables. Not a good design choice in most cases.