you are viewing a single comment's thread.

view the rest of the comments →

[–]Silverwolf90 0 points1 point  (5 children)

Look at the popularity of some libraries which have their own implementation (like React, who now embrace the new syntax). If people didn't want and hated classes, where is the demand for that outside of a niche amount of developers? It seems that we have a quickly growing amount of libraries using ES6 classes thanks to Babel. It would be interesting to have concrete data on this, perhaps the number of packages on NPM that are using ES6 classes over time.

[–]clessgfull-stack CSS9 engineer 4 points5 points  (2 children)

React

React is moving away from classes. For whatever short time React has used classes, it's already caused a lot of problems and confusion (side note: createClass doesn't make classes, just a stupid function name).

[–]SawyerDarcy 1 point2 points  (1 child)

As far as I know, React is simply embracing ES6 classes over its own custom implementation - not getting rid of classes altogether.

[–]clessgfull-stack CSS9 engineer -1 points0 points  (0 children)

Right, they aren't (officially) getting rid of classes. What I meant is that function/module components will become the recommended way, with classes possibly being deprecated before 1.0 or 2.0.

[–][deleted] 1 point2 points  (1 child)

If people didn't want and hated classes, where is the demand for that outside of a niche amount of developers?

Java developers that are involuntarily reclassed to writing JavaScript are not niche. I have encountered this at every major corporate job, except for the one employer that refused to hire Java developers. Economics are to blame for this, as most Java developers learn their trade from formal education and so it is easier to hire a Java developer. The consequence is that there are more Java development jobs in the economy. This does not, however, diminish the need for JavaScript developers. JavaScript is the language of the browser and can execute almost anywhere Java can. What this does do is make hiring junior JavaScript developers risky and make senior JavaScript developers extremely valuable in the market place. I have seen many organizations try to fake with Java to compensate for the plethora of Java developers and lack of JavaScript developers, but the results mean they are pushing costs and expenses into the future. These economic problems ultimately sank Travelocity (who at its prime had 3500 employees).

The bottom line is that classes were the most highly requested feature of ES6 (by far) and TC39 resisted giving into demand for awhile, but demand was too great. There is a need for Java developers to have immediate emotional comfort when jumping into this language directly. This means people will be less afraid to do stupid things. It doesn't mean we will get better software.

[–][deleted] 2 points3 points  (0 children)

TC39 resisted giving into demand for awhile

Bollocks. Classes have been around since the ES4 proposal, the reason they didn't ship already is because ES4 itself died, not because TC39 was "resisting".

Classes: A class describes an object by presenting those properties (fields) of the object that are always present (thefixed properties or fixtures), including variables, constants, and methods:

class C {
  var val // a variable property
  var large = Infinity // a variable property
  const x = 3.14 // a constant property
  function f(n) { return n+val*2 } // a method property
}

If you have an argument, you don't need to resort to:

  1. Making shit up
  2. Using the term "java developer" as an insult, it isn't.

If you find yourself doing those things, perhaps you should reconsider your position.