6 ms·
Good luck doing OOP in JS without `this` with minimal contortions. And to be clear, there is no `self` in JS.
by anothergoogler 8y ago
Good luck doing OOP in JS without `this` with minimal contortions. And to be clear, there is no `self` in JS.
- benbristow 8y agovar self = this;
- anothergoogler 8y agoYes, 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.
- chriswarbo 8y agoI find this comment amusing, considering that Javascript's OOP ideas are descended from Self ( https://en.wikipedia.org/wiki/Self_(programming_language) https://en.wikipedia.org/wiki/Self_(programming_language) )
- weberc2 8y agoWhy would you want to do OOP in JS?