Slashdot Mirror


ECMAScript 2016: New Version of JavaScript Language Released (softpedia.com)

An anonymous Slashdot reader writes: Ecma International, the organization in charge of managing the ECMAScript standard, has published the most recent version of the JavaScript language. ECMAScript 2016 (ES7 or JavaScript 7th Edition in the old naming scheme) comes with very few new features. The most important is that JavaScript developers will finally get a "raise to the power" operator, which was mysteriously left out of the standard for 20 years. The operator is **...
It will also become much easier to search for data in a JavaScript array with Array.prototype.includes(), but support for async functions (initially announced for ES2016), has been deferred until next year's release. "From now on, expect smaller changelogs from the ECMAScript team," reports Softpedia, "since this was the plan set out last year. Fewer breaking changes means more time to migrate code, instead of having to rewrite entire applications, as developers did when the mammoth ES6 release came out last year."

7 of 165 comments (clear)

  1. The power operator? Really? by MillionthMonkey · · Score: 4, Funny

    The power operator will get used once by one guy, who will use it in this code:

    export function pow(base, exponent) {return base**exponent;}

    To use it, enter this command:
    npm install js-power

    Then, in your code:
    const power = require('js-power');
    let eight = power.pow(2, 3);


    It's just that easy!

  2. But JavaScript isn't a success. by Anonymous Coward · · Score: 4, Insightful

    The only way JavaScript can be considered a "success" is if you define "success" to mean "used because it's the only option available".

    But aside from that very limited view of "success", JavaScript is a total disaster.

    It's a very broken language. Its type system is a wreck. It didn't have real class OO for ages, and even its prototype approach is shitty compared to Self. Its standard library is rubbish. Its syntax is mediocre. It is full of utterly stupid shit like semicolon insertion. It's a failure when looked at solely as a programming language.

    Its surrounding ecosystem is also very broken. Numerous companies and organizations have had to pour huge amounts of money and other resources into it just to get JavaScript implementations that don't limp along at a snail's pace. It has also given us clusterfucks like Node.js and npm. Building anything more than an onclick handler using JavaScript rapidly becomes a huge debacle, and a maintenance headache.

    Its community is among the worst there is. Something has to be pretty wrong with a community that thinks a language as awful and broken as JavaScript is worth celebrating! But I will give the JavaScript community credit, it isn't as terrible as the Rust community is. At least the JavaScript community's biggest offense is only ignorance. They aren't hypocrites who attack others with their tyrannical Code of Conduct, like we see some other programming language communities do.

    JavaScript just isn't a success in any reasonable sense. It's a failure.

    1. Re:But JavaScript isn't a success. by Zontar+The+Mindless · · Score: 5, Insightful

      Prototypes kick ass, if you know how to use them.

      That is, if you're not one of the many who confuses the territory (objects) with just one of the maps (classes) you can make of that territory.

      The real beauty of JS is that the notation for just about any data structure maps very neatly on to any of the others. If it's easier to work with an object at some point as a hash, you treat it as a hash. A few lines later, it proves handy to treat it as an array. Later, maybe it's best to access it as an object again.

      Apparently, most folks can't handle that kind of freedom.

      --
      Il n'y a pas de Planet B.
  3. Same reason it is bad - done in 10 days by raymorris · · Score: 5, Interesting

    JavaScript is has been the language all browsers support, but why? Also why is it so bad? The answer to both questions is the same:

    Because it was created in ten days. While Microsoft was scheduling meetings to discuss a proposal to plan a browser language, Brendan Eich created JavaScript (then called Mocha) and released it to the public. It was used because it was available, while other options were draft proposals, not yet approved for development, much less ready to use.

    When you spend all of two days designing a language and seven days implementing it, you end up with a pretty crappy language.

    The opposite end of the spectrum is Perl 6, which was designed from 2004 to roughly 2015. It's a rather nice language, for those who like Perl-like languages.

  4. Re:Have you ever actually used Python?! by viperidaenz · · Score: 4, Insightful

    I think the implication is Javascript doesn't require any repetition of white-space as part of it's syntax.

    If you just wanted to do something very simple, you could embed Javascript in an HTML attribute value. You can't do that if you require line endings and white-space as part of the language syntax.

  5. Re:hated language becomes a success by Tony+Isaac · · Score: 4, Insightful

    I think JavaScript is hated because programmers are taught in school these days to be purists. Object-oriented concepts are taught as THE way to write code, and strict type-safety is a religious commandment. There are very good reasons for good object-oriented and type-safe designs. But in the end, the goal is for the code to work.

    JavaScript is successful, I think, because of its simplicity. It is the BASIC of this generation. You can start using without having to install any tools. You can learn enough to do something useful in a few minutes, and you can actually DO something useful in one line of code. This means that lots of novices are writing lots of atrocious code out there, yes. But its low entry threshold allows many ordinary people to accomplish real work without having to study for weeks or years.

    Another reason JavaScript is successful is that it isn't "owned" by a single corporation. Remember VBScript? In many ways, in it's day, VBScript was a superior language to JavaScript. But it failed because it was a Microsoft product, and was never adopted by competing browsers. Same goes for SilverLight.

    The good news for the haters is this: WebAssembly is coming. This will make it possible for creative people to create their own, "better" languages, that will work in every browser without requiring users to install add-ins.

  6. Re:hated language becomes a success by UnknownSoldier · · Score: 4, Insightful

    > You don't understand the language

    Then why does my day job of writing WebGL apps for Smart TV's run at 60 fps then if "I don't understand the language" -- I guess these shaders just magically wrote themself ! And all those rendering optimizations just "magically" appeared in our code base !! Holy Shit !!! Ghosts are real -- shhh, don't tell the retarded Chinese Cult Politics party! (Yes, I know CCP doesn't official stand for that.)

    Don't assume. You look like an tool when you do.

    > Slashdot is full of incompetent developers like you,

    I know I shouldn't feed the Arrogant Cunt trolls, but since you you started with the ad hominem attacks, you're proof is _where_ again??

    But then again I wouldn't expect much from a coward too ashamed to hide behind an anonymous name. I guess you don't want the world to know stupid you really are.

    > Since when is a pragma a "shitty hack"?

    Are you really that fucking stupid? Wait, that was a rhetorical question -- we already know the answer to that.

    a) The FACT that this is enabled by default for ECMAScript's 6 modules should tell you that this was a HACK.

    b) Do you actually understand _anything_ about type safety and misspelling, at all?? Maybe if you had spent 30 years programming you would understand the importance of compile-time error detection and type safety? Gee, things that make our job of programming easier Go figure!

    c) Why do you keep making excuses for a shitty designed language?

    > My favorite is NaN != NaN.

    Straw man fallacy. Did I complain about isNan(x) ?? No, so quit changing topics because you've simply read What Every Computer Scientist Should Know About Floating-Point Arithmetic

    The bigger problem is the retarded "EVERY number is a double / float64" type crap.

    Gee, in ECMAScript 2 float and double are reserved word but not used. Oh wait, They are no longer in ECMA Script 5+. Make up your fucking mind !

    Never mind the fact that converting from a string to a var will OVERFLOW and NOT be EXACT.

    var s = '9223372036854775808', n = parseInt(s); console.log( n ); // 9223372036854776000 // *facepalm*

    Oh, look we have Number.isSafeInteger() but, gee thanks, for a mostly useless function as this _still_ doesn't solve the problem of needing an int64_t type.

    var s = '9223372036854775808', n = parseInt(s); console.log( Number.isSafeInteger( n ) );

    var n = (1 << 63); console.log( n ); // -2147483648; // *facepalm*

    I need an _exact_ native int64_t and uint64_t type -- WHEN will this be supported? Why do I have to use stupid hacks like "a | 0" to cast to an int??

    Javascript broken == operator is so fucked up it is laughable. WTF is the point of even having '==' when every smart programmer will use '===' instead???

    The four biggest reasons Javascript is a such as piece of shit:

    1. Automatic type conversions will get one in trouble:

    if( 0 == "0" ) console.log( "equal" ); // equal // WTF!?

    2. How about the inability to actually _include_ .js files like, you know, a concept that (almost) EVERY-other-programming language has???

    3. When Javascript does stupid shit like Automatic Semicolon Insertion (