3 ms·
So what’s your point? People should shut up and stop wanting to improve things? > The web would be a better place if Javascript developers put all of their eff
by weberc2 8y ago
So what’s your point? People should shut up and stop wanting to improve things?
> The web would be a better place if Javascript developers put all of their effort trying to write code in the language they would rather be using into writing better code in the language they are using.
Right, but then no one would use “this”...
- krapp 8y agoIgnoring or avoiding "this" isn't improving things... learning how "this" works and using it properly is improving things. Not wasting effort trying to make Javascript act like more of a functional language than it is would probably reduce the complexity and increase the efficiency of a lot of the code on the web.
- weberc2 8y agoJavaScript 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.