News for hackers. Stuff that matters.
Re:Toward Modern Web Apps with ECMAScript 6 by kaoD on Monday August 19, 2013 @05:50AM (#6236363)
So... CoffeeScript with curly braces?

On a more serious take: as a Node.js developer I can't wait for generators to be ubiquitous!

Re:Toward Modern Web Apps with ECMAScript 6 by aa0 on Monday August 19, 2013 @06:39AM (#6236462)
CoffeeScript is a debauchery of JS. With ECMAScript 6 you won't need CoffeeScript for anything except maybe it's inline printf-like string substitution.
Re:Toward Modern Web Apps with ECMAScript 6 by camus on Monday August 19, 2013 @08:36AM (#6236860)
Coffeescript saved JS dev. It proved we did not have to wait for TC39 lto get new language features.
Re:Toward Modern Web Apps with ECMAScript 6 by egeozcan on Monday August 19, 2013 @08:44AM (#6236880)
Meh. It doesn't even support getters and setters.
Re:Toward Modern Web Apps with ECMAScript 6 by virmundi on Monday August 19, 2013 @09:22AM (#6237037)
Don't use "objects". Embrace the associative array that is a JSON (I know, Object is in the name) construct. Getters and setters are not necessary with this.
Re:Toward Modern Web Apps with ECMAScript 6 by dragonwriter on Monday August 19, 2013 @09:36AM (#6237091)
How does using associative arrays reduce the need for non-trivial getters and setters? I see how it provides an alternative to trivial getter and setter pairs; just as using bare public data fields in a language that supports them does, but non-trivial or non-paired (getter or setter alone) or different visibility ones seem to be a different issue.
Re:Toward Modern Web Apps with ECMAScript 6 by virmundi on Monday August 19, 2013 @10:30AM (#6237403)
My belief is that in a functional language like JS, you shouldn't couple data with operations on itself. As a result, all you'd ever have is non-trivial getters and setters. You see this with map like constructs in Erlang. You'd have a function that takes a map and does stuff.
Re:Toward Modern Web Apps with ECMAScript 6 by Joeri on Monday August 19, 2013 @03:00PM (#6238956)
Systems built with large teams need to have their developers negotiate API boundaries. Strict typing and intelligent getters/setters help a great deal to achieve this because the code becomes self-negotiating. A second problem with large teams is that most programmers can't write pure functional code, turning the codebase into a hybrid mess. ES6 matters most for large teams because the inefficiencies of ES5 are felt most on those kinds of scale.

I'm also doubtful how well DOM programming can be mixed with a functional approach, but i'll concede that it is at a minimum possible to do it.

Re:Toward Modern Web Apps with ECMAScript 6 by dragonwriter on Monday August 19, 2013 @03:48PM (#6239322)
I don't think it's true that most programmers can't write pure functional code; I think it is more the case that that most programming languages don't provide good support -- particularly constructs that make the distinction between pure and impure code clear -- for programmers who wish to write pure functional code or at least to cleanly segregate pure and impure code.
Re:Toward Modern Web Apps with ECMAScript 6 by egeozcan on Tuesday August 20, 2013 @04:17AM (#6242390)
When I'm writing code, getters and setters are a huge help for abstraction. I won't give up using a feature only because it's not the "convention". Look at the trouble frameworks like angular and knockout go through (secondary event loop, calling functions for assignments...) because some browsers do not support getters and setters. I can use them on the server side at least.
Re:Toward Modern Web Apps with ECMAScript 6 by aa0 on Monday August 19, 2013 @12:59PM (#6238238)
Emscripten is far more worthy of the phrase 'saved JS dev.'
Re:Toward Modern Web Apps with ECMAScript 6 by apaprocki on Monday August 19, 2013 @08:04AM (#6236722)
Andy Wingo is working on generators in SpiderMonkey now that he landed them in V8. Goal is to get FF/Chrome parity. (If anyone on the IE team is reading...)
Re:Toward Modern Web Apps with ECMAScript 6 by pjmlp on Monday August 19, 2013 @09:35AM (#6237083)
Mobile is what matters nowadays.
Re:Toward Modern Web Apps with ECMAScript 6 by portmanteaufu on Monday August 19, 2013 @10:46AM (#6237494)
This seems like a non-sequitur. Could you clarify?
Re:Toward Modern Web Apps with ECMAScript 6 by pjmlp on Monday August 19, 2013 @11:41AM (#6237821)
We are forced to use only JavaScript features that are available on the system browsers of the mobile platforms, when doing web projects for mobile platforms.

So it does not matter what Firefox or Chrome support on the desktop, if those features are not widespread on the mobile platforms.

Re:Toward Modern Web Apps with ECMAScript 6 by portmanteaufu on Monday August 19, 2013 @02:46PM (#6238862)
Are the mobile editions of Chrome and Firefox far behind in their Javascript support? I was under the impression that those two were pretty much up to speed with their desktop versions.
Re:Toward Modern Web Apps with ECMAScript 6 by pjmlp on Monday August 19, 2013 @03:55PM (#6239364)
This does not work like that. It is the same thing as with IE 6.

You cannot assume everyone has a mobile device with the latest Firefox or Chrome version installed.

Most people only use the system browser, which can be whatever Webkit version depending on the iOS or Android version, Bink or mobile IE.

Some people might install the mobile versions of Firefox.

So as always, one is quite constrained if the goal is to target any mobile device with the same codebase.

Re:Toward Modern Web Apps with ECMAScript 6 by jameswyse on Monday August 19, 2013 @06:43AM (#6236472)
You can play with them just now in 0.11.2 if you run node with --harmony or --harmony-generators. Can't really use them in modules until it's in core though.
Re:Toward Modern Web Apps with ECMAScript 6 by a-l-c-o on Monday August 19, 2013 @07:34AM (#6236609)
I wonder why even play with them until ES6 features are confirmed (though it feels like they will).

It's very interesting and tempting but would end up as a loss of time if they are not.