Slashdot Mirror


Mozilla Extending Javascript?

Nomad128 writes "Mozilla's Deer Park 1 Alpha RC appears to have extended the Javascript spec for the first time in quite some time. New features include Array object methods "every" (logical AND), "some" (logical OR), "map" (function mapping), and "forEach" (iteration). They also appear to have added native XML support. Will this speed up the development of AJAX applications and give Moz a leg-up over IE7?"

54 of 286 comments (clear)

  1. Javascript Extensions by TheSpoom · · Score: 5, Insightful

    I don't think the Javascript extensions will be used very much. Personally, I'm coding Javascript that will work in most browsers, which means I have to specifically exclude this new Javascript unless IE et al also implement it (and even then, older browsers still won't like it). Not to be anti-Mozilla, but this does sound a bit like embrace and extend to me. (Yes, I know it's open source and others can read the specs.)

    On the other hand, it looks like the things that they did add were mostly based on standards and the DOM spec, so we'll see where this goes.

    --
    It's better to vote for what you want and not get it than to vote for what you don't want and get it.
    - E. Debs
    1. Re:Javascript Extensions by 1010011010 · · Score: 4, Informative

      If they are useful for people developing on the "mozilla platform", then they are useful features. For example, Firefox and Thunderbird, and extensions to each, can use these new features. They can't be used in web pages unless you want them to be Mozilla-only, of course.

      --
      Napster-to-go says "Fill and refill your compatible MP3 player", which is a lie. It's not MP3. It's WMA with DRM.
    2. Re:Javascript Extensions by eyeye · · Score: 5, Insightful

      As a XUL developer I welcome these additions that will make the language more pleasant to code in.

      They shouldnt be used where they impact on cross browser compatibility though.

      --
      Bush and Blair ate my sig!
    3. Re:Javascript Extensions by vidarlo · · Score: 2, Interesting
      I don't think the Javascript extensions will be used very much. Personally, I'm coding Javascript that will work in most browsers, which means I have to specifically exclude this new Javascript unless IE et al also implement it (and even then, older browsers still won't like it). Not to be anti-Mozilla, but this does sound a bit like embrace and extend to me. (Yes, I know it's open source and others can read the specs.)

      This mainly depends whatever any other browser picks it up. Compare this with last story, about a new browser war. Clearly the firefox developers have to keep a very sharp focus at extending and develeoping mozilla/firefox to keep up against IE7. Only thing I hope is that it won't lead to the spagethi-code-era once again...

      One thing I'm wondering is if there is a single standard for javascript. Wikipedia has a entry about javascript, mentioning ECMA-script. How does those addons fit into the standards?

    4. Re:Javascript Extensions by KiloByte · · Score: 2, Insightful

      Right, nearly all time spent coding in Javascript is spent making sure it works correctly in different browsers.
      Unfortunately, it will be a cold day in hell when IE has decent support for the standards -- and add an aeon or two until older versions of IE are phased out.

      This said, I'm not a web developer myself -- but when I updated our company's website recently, I would have spent around 10% of the time I needed. Coding around all quirks in different browsers is NOT FUN.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    5. Re:Javascript Extensions by KiloByte · · Score: 3, Insightful

      You're right. Embrace and extend is wrong anywhere.

      It's exactly why the metric system is so much better than the imperial one: instead of land miles, sea miles, survey miles, international miles, furlongs, leagues, feet, etc, you have just a single unit. Even Americans can't stick to a single mile (they have like 3 or 4) -- and this is what makes miles something really repulsive to me. Similarily with web standards: if you need to write everything separately for every possible browser and its version, everything becomes a hell -- no matter if the browsers come from the Bad or the Good side.

      --
      The creatures outside looked from Alt-Right to Antifa; but already it was impossible to say which was which.
    6. Re:Javascript Extensions by neil.pearce · · Score: 4, Informative

      Well, I only had a quick look, but these extensions don't appear to be very difficult to reproduce in other browsers...

      The following mimics the forEach extension - and works in Mozilla, Opera and IE

      Array.prototype.forEach = function(fn) {
      for(var i =0; i this.length; ++i) {
      fn(this[i], i, this);
      }
      }

      function foo(obj, index, array) {
      alert("index " + index + " is " + obj);
      }

      [4,5,6].forEach(foo);

      (Only had a quick look at the Mozilla article and 5 mins knocking the source up, so excuse any silly errors)

    7. Re:Javascript Extensions by DrSkwid · · Score: 2, Interesting

      if you did spend all day working in ajavscript, then you'd know that you can create a standard library that will work cross browser

      one can replace any functions that are missing or don't work how you like them.

      I remember back in the days before getElementById in I.E. I added my own so that I could write my code assuming it was present :

      document.getElementById = function (id) { ..... }

      as you go along you find out what works what doesn't.

      It's not *that* different from developing wxWindows or gtk to work on windows & X : find the glitches, work round 'em

      --
      There are places where the networks are not touching,and there are places where they are-Boeing's Lori Gunter
    8. Re:Javascript Extensions by neil.pearce · · Score: 4, Informative

      Ditto for "map". Actually I didn't notice they also specified an optional "this object" for forEach()...

      Array.prototype.map = function(fn, array) {
      var thisObject = array == undefined ? this : array;
      var result = [];
      for(var i =0; i thisObject.length; ++i) {
      result.push(fn(thisObject[i]));
      }
      return result;
      }

      function makeUpperCase(obj) {
      return obj.toUpperCase();
      }

      strings = [ "hello", "Array", "WORLD" ];
      uppers = strings.map(makeUpperCase);

      alert(uppers);
      alert(strings);

    9. Re:Javascript Extensions by neil.pearce · · Score: 4, Informative

      ECMA spec allows you to add in anything you want...

      A conforming implementation of ECMAScript is permitted to provide additional types, values, objects,
      properties, and functions beyond those described in this specification. In particular, a conforming
      implementation of ECMAScript is permitted to provide properties not described in this specification, and
      values for those properties, for objects that are described in this specification.

    10. Re:Javascript Extensions by mjh · · Score: 4, Funny
      As a XUL developer I welcome...

      Was it just me or did anyone else finish that sentence with, "our javascript overlords" or some other such permutation?

      I might watch too much of The Simpsons.

      --
      Key to financial independence: Spend less than you earn. Save and invest the difference. Do it for a long time.
    11. Re:Javascript Extensions by jp10558 · · Score: 2, Insightful

      Except, why would you want to exclude Opera or Konqurer or Safari?

      --
      Opera, Proxomitron-Grypen,GPG 0x0A1C6EE3
    12. Re:Javascript Extensions by ShieldW0lf · · Score: 2, Funny

      "Fuck off and die, IE" Haha, spoken like a true bitter OSS zealot

      Or a web developer... or a network administrator... or an accountant... or a construction worker... or a dentist... or a single mom... or a student... or a man... or a woman... or a child... or...

      --
      -1 Uncomfortable Truth
    13. Re:Javascript Extensions by Frizzle+Fry · · Score: 2, Funny

      I believe that Xul actually welcomes the Gatekeeper and the Keymaster.

      --
      I'd rather be lucky than good.
    14. Re:Javascript Extensions by Ibag · · Score: 3, Insightful

      I might watch too much of The Simpsons.

      Given that the joke was only used on the simpsons once, I think the more reasonable explanation is that you read too much slashdot!

    15. Re:Javascript Extensions by FrangoAssado · · Score: 2, Informative
      But the additions mentioned in this article are not "additional types, values, objects, properties, and functions". They're new reserved words, like "for" and "if".

      On the contrary, the additions mentioned in this article are simply additional methods (a method in javascript is simply a property that contains a function).

      For example, see the documentation for the new forEach() method :

      http://developer-test.mozilla.org/en/docs/Core_Jav aScript_1.5_Reference:Objects:Array:forEach

      The additions are not reserved words.

  2. What? by Umbral+Blot · · Score: 2, Insightful

    Ok I understand there are several benefits to this for extension writers. However, I seriously doubt that it will be used in many other places. After all who wants to write web pages that won't work properly in IE and Safari?

    1. Re:What? by Anonymous Coward · · Score: 2, Interesting

      Right now I'm doing some Web development work within my company where I can control all of the specs. I KNOW what computers, what browsers, &c. will be using the application and if these extensions were to prove useful, I'd just use them. The plan all along was to standardize on Mozilla for this, so that's not really a problem.

      Would I use this for a site that outsiders would ever access? No.

  3. Moz Extensions by multipartmixed · · Score: 4, Interesting

    This isn't a case of 'embrace and extend', microsoft-style -- this is a case of extra functionality needed to write extensions. Any web developer using these for public apps is clearly a butt-head.

    --

    Do daemons dream of electric sleep()?
  4. Funny... I thought ECMAScript was an open standard by spectecjr · · Score: 2, Insightful

    ... and not something that the Mozilla guys could futz around with on a whim.

    Mind you, we are talking about the people who brought you the BLINK tag.

    --
    Coming soon - pyrogyra
  5. Article badly termed? by Anonymous Coward · · Score: 5, Interesting

    They're not extending javascript from what I can see. It looks like they're implementing some features that weren't implemented before.

    1. Re:Article badly termed? by rbarreira · · Score: 4, Funny

      Yeah. In other news, I don't want to shoot you, I just want to fire a gun at you...

      --

      The AACS key is NOT 0xF606EEFD628B1CA427BEA93A9CA9773F
    2. Re:Article badly termed? by Stauf · · Score: 2, Informative

      The point is that Mozilla is simply adding a few new functions. They've also documented the functions and released them in such a way that copying them exactly woul take no real effort. Hell, you can add the same functionality to your pages, in a completely cross platform manner by including:

      Array.prototype.forEach = function(fn) {
      for(var i =0; i this.length; ++i) {
      fn(this[i], i, this);
      }
      }

      function foo(obj, index, array) {
      alert("index " + index + " is " + obj);
      }

      [4,5,6].forEach(foo);

      ... in your javascript, for example. (thanks to neil.pearce)

      These new functions, I would think, are for the writers of extentions and themes, not really for HTML authors. But, regardless, the changes are a far cry from MS's closed additions to Java that broke code written for Sun's standard JVM. These changes to Mozilla are more akin to a new header file included with GCC or such - where if you want to use the same thing with a different tool, just copy/paste.

  6. Kettle meets Pot by Neopoleon · · Score: 4, Insightful

    Great.

    So, people used to get pissed off about Microsoft playing around with scripting features in IE that weren't available on other platforms, but now it's going to be an *advantage* for Mozilla?

    Hello-o-oo-oooo-o-ooooo...

    --
    - Rory [Microsoft Employee] | Free dirt: neopoleon.com
    1. Re:Kettle meets Pot by blinkylights · · Score: 2

      Do you really not see the difference?

      You'd really have to be completely stupid to use JavaScript in a web page that only works in one browser, even if that browser has a 90% market share. You'd have to even more stupid to use JavaScript in a web page that only works in a browser with less than 10% market share.

      I really don't think these "extensions" are intended to be used in web pages. I'm also pretty dubious of your (unintended?) implication that the folks at Mozilla are doing things to lure developers to create web sites that will only work with Mozilla the way Microsoft did back when it was leveraging its OS monopoly to kill the browser market.

      Would it help you see the difference if I pointed out that Mozilla also uses some non-standard "extensions" to CSS which it uses internally for styling the GUI?

      Which you'd also have to be totally stupid to use in a web page?

  7. On the road to Mozilla 2.0 by Phoinix · · Score: 2, Insightful

    I view these developments as steps on the road of Mozilla 2.0 It makes sense that a new major version of the open source browser includes innovations just like what Netscape did for their Navigator.

  8. Make way for the "butt-heads" by Short+Circuit · · Score: 2, Interesting

    I think we're going to see some of the same things added to IE7's Javascript engine, but implemented differently.

    Which means more special-case code for web developers.

  9. Re:Firefox "stuck" at 10% market share by Tatarize · · Score: 5, Funny

    I agree, lets bundle it with Linux.

    Hmm..

    --

    It is no longer uncommon to be uncommon.
  10. what about the few of us stuck in no-mans land? by multi-flavor-geek · · Score: 2, Funny

    Great more exstentions, more media I want to block, ugh... Why can't anyone write something to block all of this stuff out, I don't want to see graphics, or animations, or hear sounds, I love Opera, and it is my browser of choice but I still have to deal with unwanted flash animations. I am stuck on 26.4 bps dialup, due to bad phone lines, and lack of avaliability for cable/dsl/direct wireless. I do not want or need to see more bloat in webpages.
    Ok, I am whining again, but you would whine too if you had to surf porn at 2.5 k/s.

    --
    Like arts? Like cheesy little Indie mags? Check out www.artwerkmag.com, and don't laugh at the bad coding please.
    1. Re:what about the few of us stuck in no-mans land? by Lifewish · · Score: 2, Informative

      If you're on Windows, I'd strongly recommend Proxomitron - a kickass personal web proxy that is able to strip out all the crap. If you're on Linux, there's Privoxy, or you could just use Greasemonkey (although that's possibly overkill).

      --
      For the love of God, please learn to spell "ridiculous"!!!
    2. Re:what about the few of us stuck in no-mans land? by Phroggy · · Score: 4, Insightful

      Great more exstentions, more media I want to block, ugh...

      I don't think you have any idea what you're talking about. These extensions to JavaScript will make the language easier to program in, which will be nice for the parts of Mozilla that are written in JavaScript (quite a bit, actually) and for things like Firefox extensions. It doesn't sound like they'll provide any undesirable functionality - we're not talking about floating popup windows here.

      Why can't anyone write something to block all of this stuff out, I don't want to see graphics, or animations, or hear sounds,

      That's precisely what several Firefox extensions do, and these additions to JavaScript will make extensions like that easier to write and maintain (and probably faster to use and smaller to download).

      I love Opera, and it is my browser of choice but I still have to deal with unwanted flash animations.

      Well, maybe you should switch to Firefox with the FlashBlock extension. Or if you really never want to see Flash animations, you could always uninstall the Flash plugin...

      --
      $x='S24;r)>63/* h@<5+oZ)32"5cz';$me='phroggy'x$];
      $x=~y+ -xz+\0-Tx+;print$_^chop$me for split'',$x;
  11. About standard compilance by Anonymous Coward · · Score: 3, Interesting

    Deviance from standards (at least in a web environement) is bad because the code that works in one browser won't work in another browser.

    But that's not necessarly a bad think in my opinion. If one browser starts extending and empowering web developper in many and novel ways, this browser may well raise the bar for all browsers and shit expectation (if developper find, in mass, that the features are worthwhile, cool, useful, etc...).

    However, deviance from standards are bad if they are unsignificant, unrevolutionary, unimportant, just a little improvement (not to confound with many little improvments that combined can make a big difference).

    So if you're going to deviate from standard, do it big time!

  12. The best part.. by Eloquence · · Score: 4, Interesting
    ..is the super fast back/forward cache (add a new positive Integer value browser.sessionhistory.max_viewers in about:config to enable it). My impression is that it's even faster than Opera's, though there seem to be some conditions under which a slower reload is used. In any case, this is an absolute killer feature, and I hope they manage to get it ready to be enabled by default for 1.1.

    The other killer feature is, of course, SVG support by default -- unlike the crappy Adobe plugin, fast and reliable SVG support. A lot of stuff that is currently done in Flash can be done in SVG without any dependency on non-free software (or unstable, experimental open source players). Personally, I'm most excited about its possible uses in Wikipedia. Unlike a bitmap file, an SVG can be collaboratively edited: translate text, fix mistakes, and so on. Beyond illustrations, SVG is also useful for zoomable timelines, of which Wikipedia has quite a few, and which are already exported as SVG.

    I think that Firefox support for SVG could be a major reason to switch from other browsers if we come up with cool SVG-based applications (not that we really need more reasons to switch!). One thing that would be neat is the ability to generally pan and zoom an SVG file even if there are no JavaScript controls for that, I haven't seen that functionality. Perhaps a bookmarklet or GreaseMonkey script could do the trick.

    I can't wait for the final version, but I'd be happy to wait 3 months longer if that's how long it takes to get it ready for primetime. One thing is for sure: Firefox 1.1 will kick butt.

    1. Re:The best part.. by BRock97 · · Score: 2, Informative

      I would like to second the parent's comments on SVG. I am extremely pumped this spec to be included by default in the next version of Firefox.

      I would like to add another use to the list, though. Having an SVG canvas to use for XUL apps will be a blast to play around with. As a weather nerd, I can't wait to create XUL web apps with a GIS backend that uses SVG to describe the map and weather data. Combining the XUL widgets with a vector based canvas area will be quite the combination.

      That said, I believe quite a few of these new extensions will come in handy when starting to program for these things. I, for one, welcome our new Javascript extension overlords...

      --

      Bryan R.
      The price of freedom is eternal vigilance, or $12.50 as seen on eBay.....
  13. Array methods by Zontar+The+Mindless · · Score: 3, Insightful

    Many of the new Array methods are similar to methods I've written myself and used for years. Admittedly the methods themselves aren't part of the ECMA spec, but object extension via prototyping is a core feature of the language. It shouldn't be difficult to implement them on your own for other browsers.

    They'll just run a bit faster in Mozilla/FireFox, is all, since they'll be run as part of the interpreter rather than as interpreted code.

    Most of the other stuff is based on W3C standards.

    Short version: I'll continue to do cool stuff quickly in Moz and spend time writing workarounds for MSIE, just like I've been doing for the last 4-5 years. Nothing particularly new about that.

    --
    Il n'y a pas de Planet B.
  14. Re:Funny... I thought ECMAScript was an open stand by slavemowgli · · Score: 3, Interesting

    Most, if not all, Mozilla extensions use Javascript, so that's most likely what these changes are aimed at. I don't think you're supposed to use them on public webpages; if the Mozilla guys really care, then they'll also make sure that these extensions won't work in that case.

    --
    quidquid latine dictum sit altum videtur.
  15. Re:Funny... I thought ECMAScript was an open stand by spectecjr · · Score: 2, Insightful

    Most, if not all, Mozilla extensions use Javascript, so that's most likely what these changes are aimed at. I don't think you're supposed to use them on public webpages; if the Mozilla guys really care, then they'll also make sure that these extensions won't work in that case.

    Funny... that exact same argument didn't work for Microsoft with their extensions to Java... why should we let Mozilla get away with it?

    --
    Coming soon - pyrogyra
  16. What the World Needs Here by Nom+du+Keyboard · · Score: 2, Insightful
    What the world needs here is a JS plug-in that works with all major browsers (or a version for each) so that there really is a compatible language across them.

    World Peace would be nice too.

    --
    "It's the height of ridiculousness to say for those 9 lines you get hundreds of millions."
  17. You know the answer by Anonymous Coward · · Score: 2, Insightful

    Mozilla Extending Javascript = yes (read the posting)
    Are web designers going to use it = no since they like "write once, run everywhere"
    Will extension developers use it = yes
    Will anybody remember the person responsible for Javascript in the first place?
    Well, see for yourself, a document that he maintains Roadmap

  18. Re:Sounds familar... by sumin+k'adra · · Score: 2, Insightful

    Uh, wow. Ever heard of domain? Let's see you get ANY php to run in ANY browser : P

    lmao

    More to the point foreach is great ... it reduces the need to do things like redeclaring variables just to be used in a for loop:

    so instead of:

    var y = x.childNodes;
    for(var i=0; iy.length; i++){
    do something with y[i]
    }

    i could just do

    foreach(x.childnodes as y){
    do something with y
    }

    So getting back to the point ... why is this a Bad Thing? of course other than the fact that I can only use it in one non-existant browser : )

    Peace,
    sk

  19. Re:Funny... I thought ECMAScript was an open stand by spectecjr · · Score: 3, Insightful

    Microsoft's problem with respect to Java was that in extending it they were breaching a contract with Sun. Of course arguments about why they were doing it didn't help them; their contract didn't provide for any such exemptions. Mozilla have no contractual obligations, that I'm aware of, to implement JAvascript/ECMAscript in any particular way.

    I don't care about the case; I care about the arguments that nearly everyone on Slashdot made at the time as to why Microsoft were in the wrong - namely that they were deliberately making it harder to write cross-platform code that worked the same way everywhere.

    When asked why this was a problem when you can turn off the extensions using a command line switch, nearly everyone wrote back that it was still subverting standards, and that software developers wouldn't know the difference between writing Microsoft-specific Java code, and regular, Sun Java code.

    The exact same argument applies here. If this goes ahead, developers won't know when they're writing Mozilla Javascript code, and when they're writing standards-correct ECMAScript code.

    The amount of hypocrisy on slashdot is amazing. It seems to be like this:

    When Microsoft subverts open standards in an embrace and extend manner, it's evil.

    When Mozilla (or anyone else does it), it's great! It's good! It's expected! It's the way innovation goes forward!

    At least you guys could discuss amongst yourselves and put out a consistent message at some point. Or heck, just be honest - if it hurts Microsoft, it's A-OK by us!

    --
    Coming soon - pyrogyra
  20. Native XML is a very neat feature by MarkEst1973 · · Score: 3, Interesting
    Using Rhino http://www.mozilla.org/rhino -- which already has the E4X functionality in the runtime -- you can stuff like this (using an html document as my sample xml):

    var html = <hmtl/>
    html.head.title = "my title";

    print(html);

    This prints as:

    <html>
    <head>
    <title>my title<title>
    <head>
    <html>

    Although this is a contrived example, I find the ability to access XML as native objects using dot-notation to be very convenient and useful.

  21. Re:Funny... I thought ECMAScript was an open stand by pomo+monster · · Score: 2, Informative

    C'mon, mods, the parent poster makes a good point. It's only "flamebait" if you're ready to apologize for the hypocrisy of the Mozilla developers.

    For the record, the new methods are NOT ECMA standards, according to the Array object reference. In other words, developers relying on these methods will be locking themselves into Gecko, unless other vendors scramble to support them, which they will likely do in buggy and incomplete ways--which, incidentally, is exactly what standards (like ECMAScript) were supposed to prevent.

    I suspect we'll be seeing similar non-standard extensions to CSS and (X)HTML in the months and years to come, rendering the W3C more and more irrelevant. The standards armistice was always a nice dream, I guess, and it was good while it lasted. So much for that.

  22. Re:Funny... I thought ECMAScript was an open stand by Anonymous Coward · · Score: 2, Insightful
    I'm well aware of the /. double standard, but the key here is intent.

    Compare the amount of IE written in Java to the amount of Mozilla written in Javascript. Compare the advantages of having a Windows-specific Java program to a 100% portable Java program. Compare the active progress of the Java standard under its developer vs. the stagnant progress of the Javascript standard, and ask yourself which language needed outside help more.

    Looks like hypocracy on the surface, but if you dissect the issue most of it goes away. That said, I'd much rather see active development of and participation in open web standards by these organizations, but none of them have even achieved full CSS2 compliance yet.

  23. Re:Slashdot post badly termed? by EvanED · · Score: 2, Informative

    You're failing to distinguish between the language and implementations of the language.

    By analogy, the C++ language has changed once since 1997 (with the technical corrigendum that fixed a couple relatively minor issues).

    However, it was only fairly recently that there has been a compiler and library that has implemented the standard apparently correctly.

    This does not mean that when a compiler writer adds support for the hell that is 'export' he or she is extending the language. By contrast, the only thing they're extending is the amount of the language their tool implements.

    I don't know what the OP was thinking, but I suspect it's along those lines.

    (Granted, from the other posts it sounds like Mozilla is in fact extending the language.)

  24. More links by jesser · · Score: 3, Informative

    This entry in Asa Dotzler's blog contains links for downloading this release candidate of Deer Park Alpha 1.1.

    The article has links to New Web Developer Features and New Extension Developer Features. There's also a page listing New Browser Features and an unofficial page listing Notable bug fixes.

    --
    The shareholder is always right.
  25. Restrict extensions to extensions by Doros · · Score: 2, Interesting

    I wish that Mozilla would only allow these language extensions (such as the -moz CSS properties) to work in Mozilla extensions. These are obviously useful language tools, but the web is divided enough as it is. This way, the browser extension development scene could serve as a test bed to language extensions. The new syntax and functions don't seem to have been widely tested. If somebody finds a problem with the initial release, will the next version of Mozilla have a new syntax? These extensions should be proposed to a standards organization. People need to stop dumping more undocumented, unstandardized stuff into the web. The way things are going, web developers will soon have to target 4 versions of Mozilla, 3 versions of Internet Explorer, Konqueror, 2 versions of Safari, and Opera.

  26. Mozilla and Cairo by krappie · · Score: 2, Interesting

    I think what deserves more attention is the badass development of cairo into Mozilla.

    Check out the blog of the main developer thats doing this development. Hes got some excellent demo screenshots.
    http://weblogs.mozillazine.org/roc/

  27. Re:Funny... I thought ECMAScript was an open stand by ky11x · · Score: 3, Insightful

    When Microsoft subverts open standards in an embrace and extend manner, it's evil.

    When Mozilla (or anyone else does it), it's great! It's good! It's expected! It's the way innovation goes forward!

    You are not arguing with any kind of logic. I still don't understand why comments like this get modded up. Sigh. So let me break this down real slow for you.

    The problem with MS's Java extensions wasn't that they added extra functionality to the language or the VM. The problem was that they did so in a non-open manner so that no other implementation of the Java language or runtime could replicate the functionality exactly, causing breakage when developers end up using MS-specific features.

    The way Mozilla is adding features to Javascript is open. The specs are out there and the code is out there. ANYBODY can re-implement the features for complete compatibility -- including by copying-and-pasting the code into IE. Do you understand this? The boys in Redmond are NOT locked out of being able to achieve complete compatibility the way other developers were locked out of achieving compatibility with MS's extensions to Java.

    For the last time: adding features and extending platforms is NOT a bad thing. This is how innovations occur. What is evil is to do so in a non-open manner so that the extensions cannot be copied and re-implemented by others.

    Hopefully we'll not have more of these "slashdot is hypocritical" arguments. It's only hypocrisy when you don't understand what was wrong with MS's behavior.

  28. Re:Avalon and XAML by josh3736 · · Score: 2, Informative
    For those of us who've been using Javascript to do things like confirm webforms ...
    For the love of god, NO!!! Do not rely on client-side scripting for input validation. If you insist on doing it, you still need to do it again on the server. Failure to do this properly opens your app to bad data and even (unnecessary) security risks. It's really not that hard to alter or fake a browser's POST data.

    Hell, I'm guilty of doing this myself. When my domain registrar asked for data they didn't need, all it took was typing a few characters in the location bar (javascript:...) to completely bypass their client-side input check and submit the incomplete form--which the server blindly accepted.

    Web apps that don't do server-side input validation are simply the hallmark of an amateur.

  29. Make out of standard obvious... by wiresquire · · Score: 2, Insightful

    IMHO, the big trap, particularly for newbies to javascript is using features/functions that are not part of the standard without knowing it.

    ie it should be very recognisable that you are using something that is not part of the ECMA standard.

    In Java land, that's made somewhat obvious by the import statement - the namespace for standard is java/javax, and, eg com.* or org.* etc are for everything else.

    Actually the same should be the case for HTML etc.It should be obvious when there are tags/features being used outside of the standard just by looking.

    The best way to let people code to standards is making it easy as hell to tell what is standard or not - without reading a gazillion pages of specs that they may not even understand.

    ws

    --

    So does Anonymous Coward have good karma?

  30. Standards? by shancock · · Score: 2, Interesting

    I guess I don't get it. If one is only developing for a private intranet and will not be accessed by any other browsers except Mozilla, then this is basically creating propriatary software where anything goes anyway. Otherwise it seems to be similar to the old Netscape/MS IE extensions war for browsers that caused so many problems years ago ( and still is causing problems).

    What happens if the company wants to scale up later to allow clients to view or to incorporate this great new stuff on the/a public website. It just doesn't make much sense to me in the long run.

    Am I missing something important here?

  31. Deer Park by NightFears · · Score: 2, Insightful

    Damn, doesn't it sound familiar to embrace-and-ex...

    Well, let's see. Netscape invented JavaScript, Microsoft did its best to break it. But, not without the help from the Mozilla Foundation, the proprietary plot has been demolished and by now everyone, except the most lazy and ignorant, seems to know that you can't trust Microsoft's innovations to lead you to the light.

    But isn't it about the time to make another step forward? And who would YOU choose to bring you there? As for me - I, for one, welcome our new stag-headed lizard overlords!

  32. Re:Funny... I thought ECMAScript was an open stand by destinationmoon · · Score: 2, Insightful

    They're not futzing around with ECMAScript; they're implementing parts of ECMA-357.

    This specification has been around since June 2004, look it up on http://www.ecma-international.org/