Want to read Slashdot from your mobile device? Point it at m.slashdot.org and keep reading!

 



Forgot your password?
typodupeerror
×
Programming Upgrades

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.
This discussion has been archived. No new comments can be posted.

ECMAScript 6 Is Officially a JavaScript Standard

Comments Filter:
  • by sribe ( 304414 ) on Thursday June 18, 2015 @08:57AM (#49936459)

    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: (Score:2, Interesting)

      by Anonymous Coward

      How dare people want you to actually close tags and use consistent casing!

  • by dmgxmichael ( 1219692 ) on Thursday June 18, 2015 @09:00AM (#49936477) Homepage
    I hate how legacy browsers act as stones around our necks.
    • Yes, yes you can use it now: https://babeljs.io/ [babeljs.io]
  • 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?

    • 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).

      • by dave420 ( 699308 )
        Off-topic, but your open letter to Iran is factually inaccurate. Apostasy is not a criminal offence in Iran. You might want to update your rant to reflect that.
        • 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

    • 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).

    • Pretty quickly. The Browser Wars are over; Chrome won.

      (posted from iceweasel)

    • I haven't checked the standard in detail, but I imagine an ES6 to ES5 compiler will come out pretty quickly. Even if this only supports the core features to start with people will be able to start migrating towards ES6 code as soon as that happens. Most of the benefits appear to be in program structure rather than performance, so native platform support isn't actually that important.
    • by jopsen ( 885607 )

      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.

  • 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.

    • by dave420 ( 699308 )
      Whereas if it was approved in the US it would be covered in bacon grease and shoot up a church! Lazy stereotypes are fun!
      • by Viol8 ( 599362 )

        It was a joke. Know what they are? Get over yourself. Oh, and I'm not an american either.

  • by Anonymous Coward on Thursday June 18, 2015 @09:26AM (#49936621)

    Good overview here: http://es6-features.org

    The big one is real classes. No more prototype boilerplate.

    • > 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:

      NOTE: A ClassBody is always strict code.

      Now if they could only clean up the rest of the crappy language. At least it's a start.

  • Spec (Score:5, Informative)

    by TFlan91 ( 2615727 ) on Thursday June 18, 2015 @09:32AM (#49936665)

    Since actually having a link to the spec in the announcement of the spec would be helpful...

    http://www.ecma-international.... [ecma-international.org]

  • Since we won't be able to use it for at least another 10 years.
  • For myself, in particular, I wonder how long it will take v8 [google.com] to support it.
  • by UnknownSoldier ( 67820 ) on Thursday June 18, 2015 @09:44AM (#49936739)

    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 ... :-/

  • It is called EcmaScript 2015.

  • Prototypical (Score:5, Informative)

    by nmb3000 ( 741169 ) on Thursday June 18, 2015 @10:07AM (#49936897) Journal

    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)

      by SirAnodos ( 463311 )

      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.

      • by nmb3000 ( 741169 )

        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

    • by Kjella ( 173770 )

      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

    • 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++

      • 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.

  • by Snotnose ( 212196 ) on Thursday June 18, 2015 @10:50AM (#49937237)
    I've used a lot of languages in the last 30 years, the only one I actively learned to hate was Javascript. Biggest problem being "everything is a global", followed by "Scope? We don't need no stinkin mouthwash", and finally having the behaviour be different on different machines because reasons.

    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)

      by Anonymous Coward

      > 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.

      • by Snotnose ( 212196 ) on Thursday June 18, 2015 @12:27PM (#49937859)
        Of course we figured it out. The answer was "very poorly".

If all else fails, lower your standards.

Working...