DEV Community

Discussion on: Rethinking JavaScript: The complete elimination and eradication of JavaScript's this.

Collapse
 
andrejnaumovski profile image
Andrej Naumovski

AFAIK, that's not really how people learn today. People are rushing to get into the current 'in' framework/library and start working, they forget the basics and the building blocks of the language on which the framework is built, which in turn prevents them from writing good, performant code and also causes new devs to introduce bugs which they can't fix because they don't know how or why a certain thing causes a bug (especially not knowing how the this binding works in JS). My point was, we need to stop abstracting everything to make it easier for new developers and actually take the time to explain how the language itself operates. That's how I did it, I went from procedural in C to OOP in C++ and Java to a mix of OOP/functional in JS. I do prefer functional as well but having a stateful class component in React and not using this seems counter-intuitive to me. Also, simply destructuring this.props or this.state at the beginning of render() removes the use of this onward. Need to pass a function as a prop and keep the binding to this? Arrow functions as class properties is a cleaner solution.

Thread Thread
 
joelnet profile image
JavaScript Joel

AFAIK, that's not really how people learn today. People are rushing to get into the current 'in' framework/library and start working, they forget the basics and the building blocks of the language on which the framework is built, which in turn prevents them from writing good, performant code and also causes new devs to introduce bugs which they can't fix because they don't know how or why a certain thing causes a bug (especially not knowing how the this binding works in JS).

Totally agree!

nothis is not an excuse to not learn the language.

NULL is considered the billion dollar mistake. It's an incredibly simple concept. Vastly more simple than this. Yet 100% of developers continue to run into null reference errors still as we speak.

How much do you think this costing us?