Mozilla Extending Javascript? 286
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?"
Javascript Extensions (Score:5, Insightful)
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.
What? (Score:3, Insightful)
Funny... I thought ECMAScript was an open standard (Score:2, Insightful)
Mind you, we are talking about the people who brought you the BLINK tag.
Re:Javascript Extensions (Score:5, Insightful)
They shouldnt be used where they impact on cross browser compatibility though.
Kettle meets Pot (Score:4, Insightful)
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...
On the road to Mozilla 2.0 (Score:2, Insightful)
Re:Javascript Extensions (Score:3, Insightful)
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.
Array methods (Score:4, Insightful)
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.
Re:Funny... I thought ECMAScript was an open stand (Score:2, Insightful)
Funny... that exact same argument didn't work for Microsoft with their extensions to Java... why should we let Mozilla get away with it?
What the World Needs Here (Score:3, Insightful)
World Peace would be nice too.
Re:what about the few of us stuck in no-mans land? (Score:5, Insightful)
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 [mozdev.org]. Or if you really never want to see Flash animations, you could always uninstall the Flash plugin...
You know the answer (Score:2, Insightful)
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 [mozilla.org]
Re:Sounds familar... (Score:2, Insightful)
lmao
More to the point foreach is great
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
Peace,
sk
Re:Javascript Extensions (Score:4, Insightful)
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.
Re:Funny... I thought ECMAScript was an open stand (Score:3, Insightful)
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!
Re:Funny... I thought ECMAScript was an open stand (Score:2, Insightful)
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.
Re:Funny... I thought ECMAScript was an open stand (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.
Make out of standard obvious... (Score:3, Insightful)
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
Deer Park (Score:2, Insightful)
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!
Re:Javascript Extensions (Score:3, Insightful)
Re:Funny... I thought ECMAScript was an open stand (Score:2, Insightful)
This specification has been around since June 2004, look it up on http://www.ecma-international.org/ [ecma-international.org]
Re:Javascript Extensions (Score:4, Insightful)
Given that the joke was only used on the simpsons once, I think the more reasonable explanation is that you read too much slashdot!