I agree that this is a good thing....if you are senior enough at javascript to understand the nuances of the scope of this and you understand how arrow functions interact with this differently than "traditional" ones -- to many junior devs, () => is just shorthand for function(). The fact that it isn't is mostly the fault of this -- and is that extra "thing you need to know" really worth keeping this around?
I've always had a love/hate relationship with magic variables (back when I first encounterd $_ in perl my mind was a little blown).
I can completely understand how avoiding them makes for more readable code.
Using this in any language is a hallmark of doing anything in OOP. Yes, JS has some things to watch out for, but the idea anyone would consider trying to drop using this altogether instead of learning the time/place and make making great things so much easier escapes me.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I agree that this is a good thing....if you are senior enough at javascript to understand the nuances of the scope of
this
and you understand how arrow functions interact with this differently than "traditional" ones -- to many junior devs,() =>
is just shorthand forfunction()
. The fact that it isn't is mostly the fault ofthis
-- and is that extra "thing you need to know" really worth keepingthis
around?I've always had a love/hate relationship with magic variables (back when I first encounterd
$_
in perl my mind was a little blown).I can completely understand how avoiding them makes for more readable code.
Using
this
in any language is a hallmark of doing anything in OOP. Yes, JS has some things to watch out for, but the idea anyone would consider trying to drop usingthis
altogether instead of learning the time/place and make making great things so much easier escapes me.