Slashdot Mirror


Web 2.0, Meet JavaScript 2.0

Jeremy Martin writes "Well I suppose it's an undeniable fact about us programmer-types — every now and then we just can't help but get excited about something really nerdy. For me right now, that is definitely JavaScript 2.0. I was just taking a look at the proposed specifications and I am really, truly excited about what we have coming."

7 of 248 comments (clear)

  1. Ugh by TheRaven64 · · Score: 5, Insightful
    Introducing classes for all of the Java programmers who can't understand a Self-like language. Great addition. Fixing the constructor syntax would have been nice, but introducing classes into a prototype-based language just doesn't make sense. Traits objects already do the same thing and a prototype style is much better suited to JavaScript's primary role, namely defining interfaces (look at some of the papers published by the Newton team in the '90s).

    Operator overloading? Great, now you can enjoy C++ style code, where left shift and print are the same command.

    All of the proposed changes are a step backwards. JavaScript is currently a language with great, clean, semantics and slightly ugly syntax. They want to make the semantics less clean and the syntax even more horrendous.

    --
    I am TheRaven on Soylent News
    1. Re:Ugh by Curien · · Score: 5, Insightful

      User-defined overloading, obviously.

      Grand-parent gave an example of built-in operator overloading, not user-defined operator overloading. So no, it isn't "obvious" that he means user-defined operator overloading.

      From the linked-to article:
      Features that are guaranteed to be misused should be eliminated.

      What a load of utter bollocks! Show me a feature that cannot be misused, and I'll show you a feature that isn't terribly useful.

      If you dont know the difference between a group, a ring, and a field, you have no business overloading operators.

      What an arrogant asshole! That's as non-sensical as an assertion that only parents have any business creating class hierarchies.

      --
      It's always a long day... 86400 doesn't fit into a short.
    2. Re:Ugh by SanityInAnarchy · · Score: 5, Insightful

      Introducing classes for all of the Java programmers who can't understand a Self-like language.

      I do agree with you there -- we don't need classes. And if we did, we could implement them, in JavaScript.

      Operator overloading? Great, now you can enjoy C++ style code, where left shift and print are the same command.

      If you really, really want to, then yes. But that it can be abused doesn't strike me as a serious reason for not including it.

      I had a problem awhile ago. It was developing for HD-DVD, meaning we didn't have full JavaScript -- meaning I couldn't, say, extend Array. Even if I could, I'm not sure how much better I could make this... I had created a control for displaying a scrolling menu of widgets of some kind. The point is, the control itself shouldn't care about what those widgets are, or even that it's operating on something that's actually an array. It would've been nice to let it work with an array for now, knowing I could always roll something that pretends to be an array later.

      Instead, what I ended up doing was wrapping the Array in a monstrosity which contained methods like getValue(), setValue(), etc. It was hideously ugly, but it would tend to work, and would even automatically wrap an Array if needed.

      But it's ugly hacks like that which drove me away from Java in the first place. I'd rather duck-type it properly, like I do in Ruby. If it claims to have a working [] operator, and has methods like size() or length(), either it's an array, or it's pretending to be one, so treat it like an array.

      --
      Don't thank God, thank a doctor!
  2. Javascript 2.0, usable by 2015... by curunir · · Score: 5, Insightful

    It's all well and good that there's new language features spec'd out, but JavaScript, at least its most common usage (web client-side) has the distinct disadvantage of lowest-common-denominator. Yes, you have JavaScript 2.0 in all it's less-horrbily-broken splendor, and you may even get Mozilla, Opera, Safari to implement it mostly correctly reasonably soon. Hell, you might even get Microsoft to include a halfway-compliant version in IE 8 or 9 (complete with a few proprietary extensions). But you'll still need to support IE 6 for a year or so and then IE 7 support will be necessary until at least 2012.

    By the time JavaScript 2.0 is available in nearly all browsers you find in the wild, there will already be a JavaScipt 4.0 spec out and you'll be able to write this exact comment with the dates and browser versions updated.

    The point being that client-side programming is a complete mess right now. Instead of new versions of scripting languages, we should be pushing browser makers to allow scripting to be installed via plug-ins rather than being native to the browser. That way, a website can trigger the user to update to the latest version of the language spec (ala the much-maligned-here flash plugin). That should also allow website authors to use any language, not just JavaScript. After all, if you're developing your site in RoR, wouldn't it be easier to use Ruby for the client-side scripting as well as the server-side? The same would go for Python, Perl, PHP (/me shudders) or even Java/Groovy.

    But as long as we are beholden to the browser manufacturers to release updates of their browsers in a timely and compliant manner, we'll be stuck in this cycle where we can't use the latest-and-greatest features until they're no longer latest-and-greatest.

    --
    "Don't blame me, I voted for Kodos!"
  3. Re:Meh. by Timothy+Brownawell · · Score: 5, Interesting

    The main problem is that given MicroSoft's history, I'm not sure I trust it. Who's to say they won't try to use it to somehow force people to their proprietary stuff?

  4. Re:v2.0 by RCanine · · Score: 5, Insightful

    Stop thinking about JavaScript as a Internet language. JavaScript and HTML rendering engines are all over the place now: Firefox Extensions, Thunderbird/Sunbird/Songbird, Dashboard, Adobe Air, Acrobat, the Wii, the iPhone...updates to JavaScript are not useful for the public Web, but are incredibly useful for highly-targeted platforms.

  5. Re:v2.0 by smittyoneeach · · Score: 5, Funny
    That depends. http://en.wikipedia.org/wiki/ECMA_Script is on version four.
    To paraphrase Palmerston:

    only three people ever understood the Java* numbering schemes: a German professor, who went mad, Prince Albert, who died, and Larry Wall - who, asked to come up with something, promptly wrote a perl script and forgot it.
    --
    Get thee glass eyes, and, like a scurvy politician, seem to see things thou dost not.--King Lear