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.
[ Parent
| on HN ]
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.
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.