Hacker News new | ask | show | jobs
by dpweb 3652 days ago
They should be working to make JS smaller and simpler and better. Focus on the philosophy of what JS should be. People instead tend to focus on 'new features'.

The power in JS is functional programming. For instance, grafting on Classes, was a mistake. They may focus on concepts like, how do we make sure we never create two ways to do the same thing - instead of how do we incorporate this new thing.

5 comments

I think the way they added classes was actually ingenious. I actually don't use classes or even prototypical inheritance, I only use functions, functions and functions. But they didn't really change Javascript at all under the hood as far as "class" support is concerned apart from some minor things at the edges - it's the exact same prototypical inheritance pattern as before, only that you write it differently. And if you do choose to use classes it's more readable now than before (yet yields the same result). So they satisfy the very big developer market of the "class people", those who like the old Javascript ways, and also those who like a functional approach. I'm content sharing the language with people who program very differently from myself and ignoring those parts.
What is your programming background? I just wondering because I also do not use classes or even prototypical inheritance but just functions. But I did not come from a class-heavy background like Java. I'd like to see a poll of those who use classes vs not in JavaScript and whether they come from a class-heavy language background (like Java) or not. My assumption is that those who come from Java prefer to use classes in JS and others not so much.
But all libraries had their own implementation of createClass, the idea was to pave a cow path that was already there, not to invent some completely new pattern.
While I don't necessarily disagree, I might argue that the power of JS comes in its flexibility. JS is as near to a 'universal' language as there is, and people are coming from a variety of different backgrounds to use it. It's convenient that it supports so many flavors of programming.
Your classes example is actually hilarious, because previously every JavaScript library that wanted classes invented their own incompatible syntax for it. Now there is one "blessed" way of doing classes.

In general this seems to be the approach of ES these days. They take ideas that have been proven or at least prototyped in userland JS or compile-to-JS languages like CoffeeScript and now Babel, and clean them up.

If they didn't push the language forward the community would continue to fragment as other compile-to-JS languages filled that demand.

I often worry that with every new standard the platform becomes more opaque for newcomers. You know, average people who want a shot at making their own webpage and learn to program for something with an immediate use case.

It's not like you have choices of language on the web, the JS jungle is intimidating enough for newbies as it is. I know many will tout compile-to-js as the solution, but that's an even higher barrier to entry and you get too-much-choice syndrome.

Not that I haven't been glad with the ES6 additions myself ...

AFAIK JS is almost completely backwards-compatible. Just ignore all the new stuff you don't really need and focus on the basics.