Hacker News new | ask | show | jobs
by anothergoogler 2708 days ago
Good luck doing OOP in JS without `this` with minimal contortions. And to be clear, there is no `self` in JS.
3 comments

I find this comment amusing, considering that Javascript's OOP ideas are descended from Self ( https://en.wikipedia.org/wiki/Self_(programming_language) )
var self = this;
Yes, I know. That doesn't make an assertion about the "pitfalls" of `self` less muddy. It's literally a variable. It's a code smell too, but that's another conversation. Are we calling out variables in JS now? Maybe we should just hold ourselves to bootcamp standards, copy and paste StackOverflow or something like that. Programming is hard, etc.
Why would you want to do OOP in JS?