Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialMike Hatch
14,940 PointsAre JavaScript Classes Controversial or Widely Accepted?
Those of you who follow Kyle Simpson (author of the very popular You Don't Know JavaScript book series) will know he's not a fan of classes in JavaScript. To understand why, you can read about it in his this & Object Prototypes book.
Is it one of those things that's best to learn for now, but could change in the future?
1 Answer
Jordan Hoover
Python Web Development Techdegree Graduate 59,268 PointsDefinitely not an expert on this, but part of the problem is its a wrapper on prototypes, which is how JS is really supposed to work. Ie. classes are for people who don't know JS...
However, frameworks like React are using it, so I'd definitely say it could be useful to know how OOP works in Javascript. Its also a very good thing to know for programming in general as many other languages use it as their primary orientation, such as Java, C++, PHP.
Mike Hatch
14,940 PointsThank you, Jordan. It sounds like you're in favor to the addition of classes to Javascript based on how they're used in React. I don't know React yet, and this question was geared towards Vanilla Javascript.
Antti Lylander
9,686 PointsAntti Lylander
9,686 PointsVery interesting question, I'm following.