The Classless Javascript Manifesto
ES6 added the class
keyword to Javascript.
This syntax is essentially a wrapper for the [[Prototype]] chain to make a more seamless transition
for developers used to other object oriented languages. It abstracts out the conventional .prototype
boilerplate.
We are proposing that Javascript developers avoid the class
keyword
in favor of clearer alternatives.
Basically, there are lots of good reasons not to use the Javascript class
keyword but the most important is that the class
keyword hides a lot of the
behind the scenes parts of Javascript and abstracts away from what is actually happening. Here is the real kicker
By confusing the two in our code, we do a disservice to ourselves and to other developers who must understand our code. It is much better to use a function or an object and work directly with the prototype.
Some big JS people have written about classes and Javascript.
Here are a few links: