33 ms·
JavaScript was a functional language from the beginning. OOP features were racked on for marketing reasons (Java was popular at the time). “This” isn’t inherent
by weberc2 8y ago
JavaScript was a functional language from the beginning. OOP features were racked on for marketing reasons (Java was popular at the time). “This” isn’t inherently more efficient than programming in a functional style.
- krapp 8y ago>This” isn’t inherently more efficient than programming in a functional style. It is, because avoiding it requires extra and unnecessary abstractions. "this" is a fundamental part of the language regardless of the paradigm. If you want to use a functional style in javascript, you have to accept that it isn't a pure functional language, and do so using "this," not avoiding it.
- weberc2 8y agoThat’s silly. “this” and other OOP features _are_ runtime abstractions built atop a more functional core. > If you want to use a functional style in javascript, you have to accept that it isn't a pure functional language, and do so using "this," not avoiding it. This is nonsense. You don’t have to do anything at all to program in a functional style in JS. You don’t need to use “this” and I can’t even imagine how using “this” would be helpful to that end.
- krapp 8y ago>This is nonsense. You don’t have to do anything at all to program in a functional style in JS. You don’t need to use “this” and I can’t even imagine how using “this” would be helpful to that end. I mean, the premise of the posted article is that javascript developers should avoid using "this" for functional (and OOP) programming, but OK... I can't tell if you disagree with me here, or the author, or what.