ECMAScript 6 looks promising
kishorelive.com
ECMAScript 6 looks promising
1–10 of 94 posts
Re: ECMAScript 6 looks promising
#2Re: ECMAScript 6 looks promising
#3Default arguments: good. Clearly useful and already used a lot with the if (foo === undefined) foo = 'default' pattern.
Non-strict destructuring: bad. It's neither destructuring-bind nor pattern matching... If I destructure a 3-list to 2 vars, I want it to fail, dammit!
Multi-line strings: good, obviously.
Templating: hello, PHP! I thought we already know better.
List comprehension: useful.
My humble opinion: it's hopeless. A mix of useful and terrible features means it'll still be made out of "the good parts" and the awful rest.
Re: ECMAScript 6 looks promising
#4Re: ECMAScript 6 looks promising
#5Except for the inclusion of "let", it is looking like Python with braces.
Re: ECMAScript 6 looks promising
#6Let keyword: good. The function scoping of vars is gruesome. Default arguments: good. Clearly useful and already used a lot with the if (foo === undefined) foo = 'default' pattern. Non-strict destructuring: bad. It's neither destructuring-bind nor pattern matching... If I destructure a 3-list to 2 vars, I want it to fail , dammit! Multi-line strings: good, obviously. Templating: hello, PHP! I thought we already know…
Re: ECMAScript 6 looks promising
#7Except for the inclusion of "let", it is looking like Python with braces.
Yes, and David actually mentioned openly in that talk that they try to borrow good ideas from other languages if possible! There are templates from PHP too :)
Re: ECMAScript 6 looks promising
#8Let keyword: good. The function scoping of vars is gruesome. Default arguments: good. Clearly useful and already used a lot with the if (foo === undefined) foo = 'default' pattern. Non-strict destructuring: bad. It's neither destructuring-bind nor pattern matching... If I destructure a 3-list to 2 vars, I want it to fail , dammit! Multi-line strings: good, obviously. Templating: hello, PHP! I thought we already know…
Re: ECMAScript 6 looks promising
#9Let keyword: good. The function scoping of vars is gruesome. Default arguments: good. Clearly useful and already used a lot with the if (foo === undefined) foo = 'default' pattern. Non-strict destructuring: bad. It's neither destructuring-bind nor pattern matching... If I destructure a 3-list to 2 vars, I want it to fail , dammit! Multi-line strings: good, obviously. Templating: hello, PHP! I thought we already know…
I don't know much about PHP, what's wrong with it regarding templating?
Couple that with variable hoisting (function scope) and hilarity can ensue when variables defined further down a function influence the value of another variable that looks like it just contains a string literal.