JavaScript standards wrangle swings Microsoft's way
Adobe dons brave face
Agentless Backup is Not a Myth
Adobe Systems appears to have been wrong footed and Microsoft left crowing on JavaScript’s evolution, following a decision by the ECMA.
After several months of wrangling, ECMA technical committee (TC) 39 - responsible for JavaScript standardization - has agreed to abandon plans for an ambitious new standard dubbed ECMAScript (ES) 4 and concentrate on evolving the current standard ES 3.1 under the new name ES Harmony. The move is seen by some as a blow to Adobe, which had based ActionScript - the language that underpins its Flash platform - on ES4.
The conflict within TC 39 spilled into the public domain in October 2007 when Microsoft's Internet Explorer platform architect Chris Wilson criticized ES 4 for trying to introduce too many changes.
Wilson's criticism was strongly countered by Mozilla chief architect Brendan Eich, a senior member of TC 39. Eich accused Wilson of "spreading falsehoods" about ES 4 and playing political games because Microsoft saw ES 4 as "a competitive threat". He also noted that Microsoft has neglected to upgrade its JavaScript compliance in Internet Explorer until it had to.
While Microsoft congratulates itself over its apparent victory, Adobe is putting on a brave face. In response to questions over the future of ActionScript, Adobe community expert Dan Smith indicated (see comments) that it would track the new ES Harmony specifications. But he also said that key features from ES4 that have now been abandoned will remain. These include namespaces, packages and classes.
Adobe does not appear to be against cutting back on ES 4 features in principle. Lars Hansen, Adobe's representative on TC 39, proposed cutting back on ES 4 features back in February 2008.®
Regcast training : Hyper-V 3.0, VM high availability and disaster recovery
COMMENTS
@AC
Tea, thank you.
I think you misunderstand. Check my code again. The only object that gets stuff added to it is the single object I refer to as 'lib' within the function, or 'my_lib' outside (same object though). It represents a collection of objects which comprise a library - effectively it is my library - and by tacking them onto a single object it prevents cluttering the global namespace.
Though I didn't say it explicitly, the make_lib() function is called once only. It's defined as a function not so it can easily create loads of identical copies of the library, because that's pointless, but so that the clutter of defining many functions can be defined within, and stay within, a single (albeit massive) function. If I didn't do that then I'd be defining the functions in the global namespace which is exactly what I was trying to avoid.
Prototypes aren't relevant here.
Put another way suppose I wanted to add a hundred functions to my app. I could just define them directly:
function add(a, b) { return a + b; }
function mult(p, q) { return p * q; }
function ... <etc, 98 more times>
Now I've added 100 names to the global namespace, and I can say:
var yy = add(3, 4)
which is pretty obvious, but my 100 definitions can clash with other people's work, or I could do this:
function make_lib() {
var lib = new Object();
lib.add = function(a, b) { return a + b; }
lib.mult = function(p, q) { return p * q; }
lib.... = function ... <etc, 98 more times>
return lib
}
I know have one (not 100) new object; that being the single function make_lib, and I instantiate it thus:
var my_lib = make_lib()
and use it thus:
var yy = lib.add(3, 4)
So, my question remains, is this a sufficient solution to David Wilkinson's namespace problem, and if not, where does it fail?
Duh!
BlueGreen,
What are you drinking? The more useful frameworks (e.g. Prototype) use Javascript prototypes, so you don't have to waste time adding redundant code to add functions to every created object!
Sheesh.
clarification
I didn't make that very clear.
Once lib has been defined (and it was done in a -huge- function that just returns the lib object, so the details within are inaccessible) then the user creates it:
var my_lib = make_lib()
and then uses it
my_lib.connect_to_server(...)

IT infrastructure monitoring strategies
Agentless Backup is Not a Myth
Top 10 SIEM implementer’s checklist
Steps to Take Before Choosing a Business Continuity Partner
Enabling efficient data center monitoring