News for hackers. Stuff that matters.
Re:Ask HN: Will front end development ever move away from Ja... by erikpukinskis on Sunday March 12, 2017 @12:38PM (#13851469)
I think ES6 is the worst thing that ever happened to JavaScript because it killed it's best feature: being a small language that runs everywhere.

Now when I want to use a JS library, I have to think: what is this author's philosophy about language extension? Are they going to start using some new feature that some other library I depend on is incompatible with?

You used to be able to run JavaScript anywhere on any device. Think about how powerful that is. We sacrificed that for supposed gains in "ergonomics".

People hate callbacks. People hate "this". But if you ask people who really learned how to use those things, they're not problems at all. They're only problems if you're coming from Ruby.

It's like someone took an Apple and said "this is gross, it's not juicy and tangy like an orange!" And then they soaked it in vinegar and wrapped in orange skins. Now it scores well on orange-ness but is that a virtue?

Re:Ask HN: Will front end development ever move away from Ja... by frogstomp19 on Sunday March 12, 2017 @02:46PM (#13852304)
I really don't agree, as a developer writing predominantly js. It's still pretty standard to compile es6 down to at least es2015 using babel or typescript, meaning js still runs everywhere. I've also literally never met anyone who thinks that callback-structured code is "not a problem". And you can work around issues of "this" and lexical scoping to the point where it isn't as irritating, but it's completely unintuitive to a new js developer, and IMO at least never stops feeling "wrong". There are also a ton of features aside from arrow functions and promises that completely change the way code is written for the better- off the top of my head I use ` string formatting, classes, let/const declarations, and module loading every day.
Re:Ask HN: Will front end development ever move away from Ja... by erikpukinskis on Sunday March 12, 2017 @03:04PM (#13852391)
> It's still pretty standard to compile es6 down to at least es2015

Yea, but that means if I want to use your library, I need a build chain. It used to be I could just do require("you") or <script src="you"> and be done with it. That's what we lost.

Actually I need n buildchains, one for each npm module I use. And they better all be compatible and target at least one common runtime. And that better be a runtime I am comfortable deploying for my app.

> I've also literally never met anyone who thinks that callback-structured code is "not a problem"

Well here I am. Pleased to meet you. Might I also point you at: http://callbackhell.com There are many of us.

I think what this really shows is how much professional ES6 programmers live in a filter bubble.

This also explains why you think "just transpile" is a reasonable substitute for a simple, run-anywhere language. Professional ES6 programmers think everyone has 40 hours a week of paid time to spend maintaining a build chain.

Javascript+Node used to be one of few languages that you could use without a build system. That's no longer the case. Maybe the loss was worth it to you. Fine. Makes sense. I wish more people would just acknowledge something has been lost, and that amateurs are struggling now at the expense of pros.

Re:Ask HN: Will front end development ever move away from Ja... by jfaucett on Sunday March 12, 2017 @03:23PM (#13852506)
I agree with a lot of your sentiment. But there's still nothing stopping you from writing ES5 or even ES3 and just ignoring ES6. Thats what we do and it works great for us. And we build extremely high end interactive apps using virtual dom, webgl, etc.
Re:Ask HN: Will front end development ever move away from Ja... by yomly on Sunday March 12, 2017 @07:51PM (#13854048)
that's really interesting - would love to know more about your JS stack and your project structure?
Re:Ask HN: Will front end development ever move away from Ja... by djmashko2 on Sunday March 12, 2017 @03:20PM (#13852491)
I think you missed that the parent meant that libraries are compiled _before_ publishing. So even if the library is written with ES6 you can simply require it with no build setup.
Re:Ask HN: Will front end development ever move away from Ja... by erikpukinskis on Monday March 13, 2017 @04:33PM (#13862072)
Many (most?) libraries are not built that way. There are plenty of libraries that use async in their exports.
Re:Ask HN: Will front end development ever move away from Ja... by z3t4 on Sunday March 12, 2017 @03:30PM (#13852555)
i wish i could upvote you 100 times.
Re:Ask HN: Will front end development ever move away from Ja... by doctorcroc on Sunday March 12, 2017 @03:10PM (#13852438)
> It's still pretty standard to compile es6 down to at least es2015

...aren't ES6 and ES2015 the same thing?

Re:Ask HN: Will front end development ever move away from Ja... by dntrkv on Sunday March 12, 2017 @05:57PM (#13853378)
Yeah, they are. People get confused because ES6 === ES2015, "ES7" === ES2016. I sometimes make the same mistake.
Re:Ask HN: Will front end development ever move away from Ja... by dorfsmay on Sunday March 12, 2017 @03:31PM (#13852563)
If you transpile down to an old version of js, does it matter what language you're transpiling from?

The minute you decide to transpile, you no longer really using javascript, and this discussion isn't really relevant any more.

Re:Ask HN: Will front end development ever move away from Ja... by tracker1 on Monday March 13, 2017 @04:42AM (#13856168)
Well, jQuery is the single most popular JavaScript library ever, with over a decade under its' belt, and going to be around for likely another. Its' style was not predefined by the JS language... It has a monadic style in nature... Likewise, JS didn't prevent coffee-script or transpilers...

That said, I still feel that not sending the event registration context (not just the target) in with the event is a mistake... escalated by the use of fat-arrow functions today. You never know where things will go.

As to callbacks, I think it provides a great base... allows for easy extension and progression. I do now prefer Promises where async/await is available or via babel.

Java 8 isn't the same as Java 3... it's changed... languages evolve, and JS has done so rather rapidly the past 6+ years... It looks to be settling in a bit now. Next will be the module support, and that shift will be more painful than everything that came before.

I don't mind the context class sugar... there are places where it makes sense, and far cleaner than the prototype syntax. I tend to only use it for UI components, and even then sparingly. Just the same, other parts of ES6+ have been incredibly great.

Re:Ask HN: Will front end development ever move away from Ja... by woah on Sunday March 12, 2017 @04:20PM (#13852841)
What are you talking about? ES6 transpiles down to ES5, and this is what people publish libraries as. The language version compatibility story is way better than it is for most languages.
Re:Ask HN: Will front end development ever move away from Ja... by ng12 on Sunday March 12, 2017 @02:07PM (#13852049)
Who's writing native ES6 code? Support for IE8 is just now starting to slip in the community (due too old, mundane things like Object.defineProperty). Almost every package on NPM targets ES3. Also, IE never ran everywhere. Targeting IE8 is hard, targeting IE6 was a nightmare.
Re:Ask HN: Will front end development ever move away from Ja... by geuis on Sunday March 12, 2017 @02:54PM (#13852350)
I can't speak for you, but I've worked at a few companies and done some contracts overs the last 5 years and supporting ie8 easily stopped around 2012.
Re:Ask HN: Will front end development ever move away from Ja... by ng12 on Sunday March 12, 2017 @03:08PM (#13852417)
Microsoft ended support for IE8 early 2016. Until then most open-source libraries supported it. I wrote an IE8-compatible application this year and only had to downgrade a few random libraries.
Re:Ask HN: Will front end development ever move away from Ja... by StavrosK on Sunday March 12, 2017 @02:27PM (#13852179)
I see this misconception a lot in this thread. "Yes, people say the language has problems, but there are people can work around the problems, so they aren't really problems!"

The very fact that you need to learn to work with X means that it's a problem. Otherwise, all languages are just fine.

Re:Ask HN: Will front end development ever move away from Ja... by z3t4 on Sunday March 12, 2017 @03:08PM (#13852418)
everything is stupid if you dont understand it. JS is pretty good at not getting in your way.
Re:Ask HN: Will front end development ever move away from Ja... by StavrosK on Sunday March 12, 2017 @04:35PM (#13852942)
There is no "stupid" and "clever". There's only "consistent" and "inconsistent". JS isn't very consistent.
Re:Ask HN: Will front end development ever move away from Ja... by coldtea on Sunday March 12, 2017 @03:45PM (#13852640)
>everything is stupid if you dont understand it.

Some things are stupid even after you understand them, and JS has plenty of those, as its creator and its greater evangelizer both admitted.