|
|
|
|
|
by jschrf
3360 days ago
|
|
I think this is just a trope that JS devs and newbies have launched on to, and that it's without merit. Classes are good. Classes express concrete taxonomies of concrete things in ways that most developers can understand. I think we should be happy that JS is flexible enough that adding "class" to the language is almost purely syntactical: it clarifies and makes semantic a bunch of otherwise boilerplate "Foo.prototype.blah" code that you see in so many non-trivial JS apps. Classes simplify things IMO. |
|
The reasons they give are that 1) you should favor composition and delegation over classical inheritance 2) classes keep you from using and understanding closure and other functional patterns and 3) you just get a lot of really weird behavior when trying to use classes in JS which results in a lot of confusion and wasted time, especially for those who don't have 10 years of experience under their belt.
Edit: Here's Simpson's take: https://github.com/getify/You-Dont-Know-JS/blob/master/this%...