News for hackers. Stuff that matters.
Re:The state of JavaScript modules by sergiotapia on Monday May 29, 2017 @03:04AM (#14437819)
Just like when Meteor was the hottest kid on the block, ES6 came along and pulled the rug out from under me.

Now that I'm finally used to ES6, here comes some other frankenstein with more flesh bolted on.

At what point will Javascript relax and stop reinventing itself and what works? When will stability become a core goal for the Javascript thought-leaders?

I haven't worked with .NET and C# for years but I bet I could feel right at home today. I couldn't say the same for Javascript.

Re:The state of JavaScript modules by tlrobinson on Monday May 29, 2017 @03:51AM (#14437956)
Before ~2015: "JavaScript is a terrible language!"

After ~2016: "Stop improving JavaScript, I can't keep up!"

(Not a personal attack, just general sentiment I've observed)

Re:The state of JavaScript modules by andreareina on Monday May 29, 2017 @07:21AM (#14438557)
I've been using JS lightly for a couple of years, in earnest for a couple of months. From the perspective of someone who's comfortable in C, Lisp, Python I think the semantics are fine (given a certain subset).

One major issue I have with JS is that the standard library is severely lacking in the basics. We have Promises but Math.round only rounds to the nearest integer. We have generators but no string formatting (the template syntax is not a replacement).

Re:The state of JavaScript modules by camus2 on Monday May 29, 2017 @05:01AM (#14438173)
> After ~2016: "Stop improving JavaScript, I can't keep up!"

The bad parts are still here that's the problem. The language didn't improve so much that it got new features. But var, ==, type coercion and co still exist.

Re:The state of JavaScript modules by Vinnl on Monday May 29, 2017 @06:09AM (#14438371)
> But var, ==, type coercion and co still exist.

They all have alternatives, and linters can help restrict you to those alternatives. As a developer, that makes it pretty doable.

I presume you too can appreciate why they can't simply be removed.

Re:The state of JavaScript modules by aaron-lebo on Monday May 29, 2017 @05:17AM (#14438220)
So use a linter which disallows var and some of the worst usages and and use libraries which make up where it's lacking.

It's the price of improving the language + backwards compatibility.

Re:The state of JavaScript modules by camus2 on Monday May 29, 2017 @05:33AM (#14438266)
A linter never fixed the runtime behavior of a language, this is beside the point. The point is the assumption that Javascript is a better language today.
Re:The state of JavaScript modules by aaron-lebo on Monday May 29, 2017 @05:38AM (#14438281)
You mentioned var, let exists to fix those issues, hence the language just in that one area is better.
Re:The state of JavaScript modules by tlrobinson on Monday May 29, 2017 @06:29AM (#14438422)
The first two are totally solvable with a couple ESLint rules (`===` and `no-var`), and the latter somewhat solveable with TypeScript or Flow.
Re:The state of JavaScript modules by _pmf_ on Monday May 29, 2017 @04:22AM (#14438046)
To be fair, those are not mutually exclusive options.
Re:The state of JavaScript modules by sim0n on Monday May 29, 2017 @03:17AM (#14437851)
You don't have to use the hottest new framework or language feature. The JavaScript you're writing now will still be supported while the language evolves and improves.
Re:The state of JavaScript modules by kuschku on Monday May 29, 2017 @03:44AM (#14437937)
Nice idea, but false. Your code depends on libraries and frameworks, which constantly change and adapt to the the mood of the time.
Re:The state of JavaScript modules by octalmage on Monday May 29, 2017 @04:06AM (#14437997)
Many libraries that use ES6 features distribute the transpiled version through npm or GitHub. If they don't, you can just transpile the library using Webpack then use that.

Or you could use codemods to update your code base in an automated way. See: https://github.com/cpojer/js-codemod

Re:The state of JavaScript modules by tlrobinson on Monday May 29, 2017 @03:55AM (#14437963)
So transpile the library. Webpack and others can do it.
Re:The state of JavaScript modules by zmmmmm on Monday May 29, 2017 @08:19PM (#14442252)
If it was just about transpiling, that would be fine. The problem is that some frameworks (eg: React) add on a whole lot more assumptions about how how your app works. Just look at the plethora of blog posts, tutorials and even whole mini-frameworks just to get d3 to work with React.
Re:The state of JavaScript modules by pluma on Monday May 29, 2017 @05:57AM (#14438343)
Your mistake was picking Meteor because it was "the hottest kid on the block". It never was as popular as it was made out to be, it was just hyped to no end and super appealing to people who were new to JS (because realtime/webscale/buzzwords).

Today Meteor has mostly overcome its initial NIH obsession and thus mostly become irrelevant unless you're already a Meteor user.

It's never the right choice to jump on whatever bandwagon is all the rage at any given moment. Just look at what's been around and is still seeing active development if you want something with a long lifetime.

Personally to a newcomer to JS who wants something that'll work for a while I would probably recommend Ember or if they want something slightly more newsworthy I would recommend Angular.

On the other hand if you want to learn JS as a language and aren't afraid to go through a number of iterations of picking and discarding libraries, I would recommend what I prefer myself: React, followed up by Redux once you've outgrown toy applications.

Re:The state of JavaScript modules by eindbaas on Monday May 29, 2017 @03:16AM (#14437850)
Why does your app have to be bleeding-edge?
Re:The state of JavaScript modules by sergiotapia on Monday May 29, 2017 @03:18AM (#14437854)
If I hadn't migrated to ES6, I would not have been able to use some javascript packages I enjoy. For example: https://github.com/JedWatson/react-select
Re:The state of JavaScript modules by dalailambda on Monday May 29, 2017 @03:36AM (#14437911)
There doesn't seem to be any part of that package that requires ES6 to use. You can use it as an ES6 module, but the commonjs version should work fine as well.
Re:The state of JavaScript modules by tlrobinson on Monday May 29, 2017 @03:48AM (#14437945)
You can transpile dependencies without migrating your whole app (though I'm not sure why you would)
Re:The state of JavaScript modules by BillinghamJ on Monday May 29, 2017 @04:37AM (#14438098)
> I haven't worked with .NET and C# for years but I bet I could feel right at home today

You'd be surprised. It is shockingly different now - they are in the early stages of exactly what happened to JS.

I'm sure the outcome will be really beneficial for everyone, but at the moment it's very confusing if you aren't constantly monitoring it and keeping up-to-date.

Re:The state of JavaScript modules by rimliu on Monday May 29, 2017 @03:30AM (#14437891)

  > At what point will Javascript relax and stop reinventing
  > itself and what works?
I am afraid part of the reason for this is continuous effort to put a square peg into a round hole (by this I mean the "web for everything, JS for everything" attitude), so it will go on for a while.