this post was submitted on 22 Jul 2025
469 points (97.4% liked)

Programmer Humor

25253 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
[–] eager_eagle@lemmy.world 83 points 4 days ago* (last edited 4 days ago) (4 children)

nah, I'm never complaining about self in Python after having tried the this and that nonsense in JS.

oh, you're using a named function instead of an arrow fn? Guess what, this is not what it used to be anymore.

[–] joyjoy@lemmy.zip 21 points 4 days ago (1 children)

Oh, you assigned a method to a variable before calling it? Congratulations, this is now undefined.

[–] pinball_wizard@lemmy.zip 4 points 3 days ago (1 children)

Yes. There's no telling what this is. this could be anything. We tried to keep track of this, but no one knows when this will change.

[–] joyjoy@lemmy.zip 7 points 3 days ago

I used to be with this, but then they changed what this was.

Now what I'm with isn't this, and what's this seems weird and scary to me.

This'll happen to you!

[–] kayohtie@pawb.social 30 points 4 days ago (2 children)
[–] theit8514@lemmy.world 42 points 4 days ago (1 children)

Only if you define it.

const that = this

[–] mesamunefire@piefed.social 14 points 4 days ago (1 children)

I remember that a long time ago. Oh god

[–] Aurenkin@sh.itjust.works 6 points 4 days ago

I remember this too... what a nightmare.

[–] eager_eagle@lemmy.world 30 points 4 days ago* (last edited 4 days ago) (1 children)

it's common practice as a workaround to save this when changing contexts, since this may change under you, in callbacks and such

[–] Johanno@feddit.org 2 points 3 days ago

Kotlin:

this@outerFunction.bla
[–] mesamunefire@piefed.social 7 points 4 days ago

Yeah totally agree.

[–] dufkm@lemmy.world 4 points 4 days ago

As a non-programmer who's occasionally dabbled with wxPython, I've entangled myself with self.parent.parent and their childs/siblings more than once. At that stage I know my project is done.