ECMAScript 6 Is Officially a JavaScript Standard 80
rjmarvin writes: The ECMAScript 6 specification is now a standard. ES6 is the first major revision to the programming language since 1999 and its hallmark features include a revamped syntax featuring classes and modules. The Ecma General Assembly officially approved the specification at its June meeting in France, ECMAScript project editor Allen Wirfs-Brock announced.
Yay! (Score:3)
This really marks the triumph of the newish and competent committee over the prior boneheads who wasted years trying to shove XHTML down our throats while adding features that were so poorly designed as to be nearly worthless. (ES5 marked the transition, the first cleanup after the prior mess, and ES7 will finally get us to where the language should have been 10+ years ago if not for all the time wasted by wankers with no clue about actual software development.)
Re:Yay! (Score:4, Informative)
What kind of features were worthless?
Semicolon insertion.
Idiotic scoping rules.
Bad handling of NaN and null.
Hidden prototype items in arrays/objects.
"with" statement.
"==" not working like "===".
"void"
Many more listed here: Bad parts [oreilly.com]
And here: Awful parts [oreilly.com]
Re: (Score:2)
To be fair IEEE 754 (Or IEC 60559 to be more precise.) have plenty of flaws
Yes, it has flaws, but it also has one ENORMOUS advantage: it is implemented in hardware on almost any computer doing JavaScript. Complaining about IEEE 754 rounding rules is silly, because that is not at all a problem specific to JavaScript. Crockford also complains about bitwise operators and the increment operator (++). Bitwise operators are often indispensable, and ++ is obvious and idiomatic to anyone used to C/C++/Java/Perl or any of many, many other languages.
Re: (Score:2, Interesting)
How dare people want you to actually close tags and use consistent casing!
Re: (Score:1)
So that means in ten years we can use it right? (Score:5, Insightful)
Re: (Score:1)
Re: (Score:1)
Why not replace the www with a proprietary binary format
Exactly.
Re: (Score:1)
Sure, let's call it "gecko". Now convince Google, Apple, Microsoft to drop their engines and use it.
Re: (Score:2)
Well that's sort of the situation that accidentally exist on iOS and even on that platform there has been some demand for different engines. There are tradeoffs between engines. Say for example an engine has a bug. Do you continue to process data in line with that bug for application compatibility or fix it? Should the engine focus on newest features or on standards compliance? Should it focus on security vs. compatibility? Should it focus on minimizing time to render or minimizing power drain?
Re: (Score:2)
It is far better to specify the standard and code against the standard. If there are problems with a particular browser they can be disc
Great (Score:2)
How long until we can actually use it? How long until Chrome, Edge, Firefox, Opera and Safari supports it on all their respective supported platforms?
Here is an answer (sort of) (Score:3)
Seems it will roll out peicmeal like other HTML JavaScript enhancements in the past
A quick google turned up this useful link.
Browser Compatibility [github.io]
With many browsers you can use many features now (but not all).
Re: (Score:2)
And Yet... (Score:3)
While not "Officially" Codified as a Capital Crime, it is often sanctioned and applied by the state.
Apostasy in the Islamic Republic of Iran [iranhrdc.org]
From Wikipedia on Apostasy "Iran – illegal (death penalty)"
The catch here is it is often applied under the broad umbrella "blasphemy."
What else makes my journal entry a rant? Who is being more intellectually dishonest here?
Do you stand corrected that the death penalty is often given in Iran for apostasy, or do you have some evidence to the contrary proving that
Re: (Score:2)
How long until we can actually use it? How long until Chrome, Edge, Firefox, Opera and Safari supports it on all their respective supported platforms?
Considering it used to be Mozilla only project, I think they already have most of it. As for the rest: They will probably never get it for the same reason it was never default available in Firefox: It is not backwards compatible (unless they fixed that sometime the last 5 years).
Re: (Score:3)
Pretty quickly. The Browser Wars are over; Chrome won.
(posted from iceweasel)
Re: (Score:1)
Re: (Score:2)
Re: (Score:2)
Various ES6 to ES5 transpilers already have existed for quite a long time.
https://babeljs.io/ [babeljs.io]
https://github.com/termi/es6-t... [github.com]
https://github.com/google/trac... [github.com]
https://esnext.github.io/es6-m... [github.io]
https://github.com/matthewp/es... [github.com]
Re: (Score:2)
How long until we can actually use it? How long until Chrome, Edge, Firefox, Opera and Safari supports it on all their respective supported platforms?
Compile w. babeljs.io for now... But Chrome and Firefox will probably have support relatively soon. FF has had much of ES6 internally for years.
So it was approved in France? (Score:2)
That means there must be some new error syntax to emulate a gallic shrug and some vague hand waving. A much nicer alternative to a a meaningless number or some unfriendly message.
Re: (Score:3)
Re: (Score:1)
It was a joke. Know what they are? Get over yourself. Oh, and I'm not an american either.
What's in Javascript 6? (Score:5, Informative)
Good overview here: http://es6-features.org
The big one is real classes. No more prototype boilerplate.
Re: (Score:2)
> No more prototype boilerplate
Definitely a nice touch but not mandatory. Using anonymous closures isn't THAT hard to do with inheritance with.
The nice thing about classes in Section 14.5 [ecma-international.org] is this note:
Now if they could only clean up the rest of the crappy language. At least it's a start.
Spec (Score:5, Informative)
Since actually having a link to the spec in the announcement of the spec would be helpful...
http://www.ecma-international.... [ecma-international.org]
Doesn't Matter (Score:1)
How long until rollouts... (Score:2)
Wow, they got modules before C++ (Score:3)
Surprised they got modules so quickly. Someday modules will eventually make it into C++ ...
* 2006 http://www.open-std.org/jtc1/s... [open-std.org]
* 2014 http://www.open-std.org/jtc1/s... [open-std.org]
* 2015 http://www.open-std.org/JTC1/S... [open-std.org]
* 2015 (April) https://isocpp.org/files/paper... [isocpp.org]
* http://www.infoq.com/news/2015... [infoq.com]
* http://stackoverflow.com/quest... [stackoverflow.com]
I see the "use strict" HACK is still optional ("An ECMAScript Script syntactic unit may be processed using either unrestricted or strict mode syntax and semantics. ") but at least in the case of a class is mandatory ("A ClassBody is always strict code.") Someday Javascript will stop being a shitty language. Sadly it won't be this year ... :-/
No (Score:2)
It is called EcmaScript 2015.
Prototypical (Score:5, Informative)
revamped syntax featuring classes
So they just gave up on the whole prototype system and duct taped class-based OO on top of it? That's actually kind of sad -- It was a special aspect of Javascript that set it apart from other languages, and homogenization is boring. I guess maybe today's "Javascript developers" just couldn't wrap their heads around it.
Here's a rundown of the new features [github.com] if anyone else hasn't been following ES6 and is curious. A few of note are
scoped and const declaration via let and const,
lazy iterators and generators,
format/heredoc strings,
and varargs ala Lua.
Overall this looks like a good step in bringing Javascript closer to being on par with more modern languages.
Re: (Score:3, Insightful)
So they just gave up on the whole prototype system and duct taped class-based OO on top of it? That's actually kind of sad -- It was a special aspect of Javascript that set it apart from other languages, and homogenization is boring. I guess maybe today's "Javascript developers" just couldn't wrap their heads around it.
They did not give up on the prototype system. To quote from the link you shared:
ES6 classes are a simple sugar over the prototype-based OO pattern... Classes support prototype-based inheritance, super calls, instance and static methods and constructors.
It's just sugar. It's all prototype inheritance underneath the sugar, and you are still free to not use the sugar and keep using prototype inheritance like you always have.
Re: (Score:2)
It's just sugar.
True, but the end result is the same. All the same people will continue to pretend that the language is built for classes and ignore prototypes, but now even more will just use the classes interface since it's "official" now. This leaves projects or developers who do use prototypes even farther out in left field, since classes have become an even more common practice.
I'm not going to say it's good or bad thing in a productivity or business sense, since classes are clearly more common and familiar to most
Re: (Score:2)
So they just gave up on the whole prototype system and duct taped class-based OO on top of it? That's actually kind of sad -- It was a special aspect of Javascript that set it apart from other languages, and homogenization is boring. I guess maybe today's "Javascript developers" just couldn't wrap their heads around it.
And a very frustrating aspect for all the developers familiar with C# / ObjectiveC / Swift / C++ / Java / VB whose job it was to port traditional applications to be web applications. And YMMV but in my experience object oriented programming is a pretty good model for GUI front-ends, all the windows and dialogs with their menus, toolbars, buttons and so on have a ton of state and fire events like a button saying "I just got clicked" or a dialog saying "The user just closed me". Many people have wasted thous
Re: (Score:2)
I assume they just grew tired of the uniformed C++ masses saying. "JS is not 'real' OO, `cause it has no classes".
Classes are not required for objects, obviously. JS always had objects with properties and methods. And while using objects as prototypes for creating other objects is different than a Class based system, objects are still objects.
They just caved, and added class syntax sugar. You can still use JS the original/correct way, and ignore the class syntax.
I guess the class syntax does help those C++
Re: (Score:3)
You can still use JS the original/correct way
Oh, thank god there's finally a single person who can serve as the undisputed arbiter of the "correct way" to use JavaScript.
Now if only we could force the entire world to listen to you.
The only language I've ever hated (Score:4, Funny)
After 6 months of schedule slipping and very poor quality we finally convinced management to let us use perl. Perl ain't perfect, but it's predictable.
Re: (Score:3, Insightful)
> Biggest problem being "everything is a global"
6 months, and you did not figure out how Javascript scoping works? ... and you went back to perl ...
ouch.
Re:The only language I've ever hated (Score:4, Insightful)
Re: (Score:2)
are what is offered to denigrate a language as widely used as Javascript then
If the best thing you can say about Javascript is that it's widely use, then you have a really lousy argument on your hands. If you use that as an argument at all, it shows you have poor understanding of the ecosystem.
Re: (Score:2)
This isn't all just about globals. It is also about the hilariously stupid rules for scoping locals (where you can put "var" inside a block, but for some mysterious reason it will always be scoped in the outermost function body - contrary to both common sense and every other language with the same syntax for blocks).
And for extra giggles, there's the mess that is the overlap of closures and foreach loops.