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

 



Forgot your password?
typodupeerror
×
Programming Mozilla The Internet IT

Brendan Eich Explains ECMAScript 3.1 To Developers 94

VonGuard writes "On April 9, ECMA International produced the final draft for the first major update to JavaScript since 1999. It's called ECMAScript 3.1, but will soon be known as ECMAScript, Fifth Edition. You'll know it as JavaScript, the Next Generation. Mozilla will begin implementing these features after Firefox 3.5, and Microsoft is already showing prototypes behind closed doors. The question, however, is what this will change for JavaScript coders. To get those answers, I tracked down Brendan Eich, Mozilla's CTO and the creator of JavaScript. I transcribed the interview without any editorial since he explains, perfectly, what's changing for programmers. Long story short: Json will be safer, getters and setters will be standard, and strict mode will make things easier to debug."
This discussion has been archived. No new comments can be posted.

Brendan Eich Explains ECMAScript 3.1 To Developers

Comments Filter:
  • by Rik Sweeney ( 471717 ) on Friday April 17, 2009 @09:12AM (#27610923) Homepage

    With Microsoft cooperating to improve the language, now we can move on beyond the fifth edition, toward ECMAScript harmony.

    Whatever happened to Embrace, Extend, and Extinguish?

    Extend is right there in bold

  • jQuery() (Score:3, Insightful)

    by Anonymous Coward on Friday April 17, 2009 @09:23AM (#27611115)

    As long as using jQuery doesn't change, I'm good. :)

  • Re:OOP? (Score:4, Insightful)

    by johnnysaucepn ( 1263108 ) on Friday April 17, 2009 @09:25AM (#27611163)
    Probably around the time you realise that object-oriented doesn't mean class-oriented.
  • by e4g4 ( 533831 ) on Friday April 17, 2009 @09:26AM (#27611179)

    It's just too problematic to have to code separate DOM funtionality for every browser on the market.

    These days, most of the forking is done in the library you're using - I rarely need to fork my code based on specific browsers anymore.

  • Sanity? (Score:5, Insightful)

    by Millennium ( 2451 ) on Friday April 17, 2009 @09:34AM (#27611323)

    JavaScript does OOP in a sane manner. It's not the same manner as many traditional OO languages, to be true -it's prototype-based instead of class-based- but it's every bit as sane in its own way. It's just different.

    The major reason you find OOP in JavaScript to be "insane" is that you are tearing your hair out trying to shoehorn in this particular paradigm that the language wasn't designed to use: sure, you can do it, but it's a lot of extra effort for very little gain in the end. That's not a problem with the language, but with programmers who resist the flow of that language. Just let JavaScript be JavaScript, and you'll find that things get much saner, or at least a lot less maddening.

    Seriously: what harm ever came from learning new ways to do things?

  • Re:OOP? (Score:4, Insightful)

    by BlitzTech ( 1386589 ) on Friday April 17, 2009 @09:47AM (#27611525)
    If you don't understand the expressive power and usefulness of functions as first class objects, you should really try using JavaScript differently. As for why you're using Object instances as classes, have you never used Java?

    Also, you don't have to set the prototype all at once in a single object. The prototype keyword is used for functions that are common to all instances of the object; you can just as easily set the functions inside the constructor, but that creates a new function object for each instance instead of using one function object defined in the prototype and thus requires more memory. This allows you to change your object's behavior on the fly (if you so choose).

    In short, OOP in ECMAScript is not 'totally retarded' at all, just outside your comfort zone. Try it first, THEN flame it, if you still think it's awful.
  • you should be able to code in straight javascript in all browsers the same. obviously, you can't do that now. but that doesn't justify the existence of libraries, it just means they are temporary bandaids that should go away with the implementation of the next javascript (crossing fingers)

  • Re:Sanity? (Score:3, Insightful)

    by Anonymous Coward on Friday April 17, 2009 @10:46AM (#27612873)

    Ahh the sign of someone who doesn't understand the difference between OOA/OOD and OOP.

    The 4-digit /. ID you were replying to was referring to classes as they appear in 3GLs like C++, Java and C#, not to the "OO" word "class".

    And that was perfectly clear from the context.

    Go read good books on OO BitZtream, and try again later.
     

  • Re:jQuery() (Score:2, Insightful)

    by chdig ( 1050302 ) on Friday April 17, 2009 @11:56AM (#27614547)

    jQuery is what JavaScript *should* have been all along.

    No, jQuery is a very good javascript framework, but its api should have no part -- at least yet -- in javascript itself.

    Right now, the differences in coding an application with jQuery's framework compared to Ext/Prototype/GWT/etc are greater than the differences in coding javascript for IE vs Firefox. Frameworks are a personal choice of how you prefer to code, and one single framework should not be forced onto all coders.

    To say jQuery is what JavaScript should have been is like saying that Ruby on Rails is what Ruby should have been, or that symfony or CakePHP is what PHP *should* have been. ie:apples vs oranges comparison.

    While I hope, like the sibling poster mentioned, that the DOM api is improved, I certainly don't want jQuery to become the next standard of JavaScript.

  • by drew ( 2081 ) on Friday April 17, 2009 @12:17PM (#27614987) Homepage

    It sounds like they decided to go with shoring up the language as it is currently used rather than make sweeping new changes. Good for them. I'm not sure if it was Adobe's doing or Macromedia's, but they really threw out the baby with the bathwater with the "transition" from ActionScript 2 to ActionScript 3. Rather than fixing up the obvious problems with AS2, like silently swallowing errors and gaping holes in the functionality of core objects, they abandoned it entirely and replaced it with some bizarre mutant language from a parallel dimension. I still have to wonder why, if they were willing to completely abandon both backward compatibility and developer familiarity, they didn't just decide to switch to an existing language. As far as I can tell, the only thing that AS3 really accomplished was to reimplement Java, and poorly.

    For a while, it looked like the next version of JavaScript was following down a similar path. Glad to see that's not going to be the case.

  • Re:Json vs. XML (Score:2, Insightful)

    by beegeegee ( 1336603 ) on Friday April 17, 2009 @02:38PM (#27617789)
    var name;
    //JSON
    name = eval(jsonString).name

    //XML (at least in IE)
    var xmlparser = new ActiveXObject("MSXML2.DOMDocument.3.0");
    var doc = xmlparser.loadXML(xmlString);
    name = selectSingleNode("name").value;


    That's one reason.

"More software projects have gone awry for lack of calendar time than for all other causes combined." -- Fred Brooks, Jr., _The Mythical Man Month_

Working...