this post was submitted on 08 Jun 2025
294 points (97.4% liked)
Programmer Humor
23995 readers
1403 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
- Keep content in english
- No advertisements
- Posts must be related to programming or programmer topics
founded 2 years ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
At the time JS was created, Perl didn't have a
this
. A lot of the docs and books suggested using$self
but a reference to the object would be passed as the first parameter to all class methods and you assign that to any name you wanted.It's only very recently (as in the last year or so) with a new
class
system that Perl has hard-coded$self
for that purpose.I mean
$_
.Ah. The usually implicit topical "this" didn't even occur to me because I thought, er, this, was about objects.
$_
isn't used for those in Perl.I suppose there might be some parallels with the implicit nature of
$_
in non-OO contexts in Perl versusthis
in OO contexts in Javascript, but, at least to me, that feels pretty tenuous.