views:

432

answers:

6

EcmaScript Fifth Edition, or Ecma-262, has been announced and contains some changes to the language. What features in the new version are going to help you write better code?

A: 

Sadly, absolutely nothing, since IE will not support any standards that are newer than five years or so.

Deniz Dogan
Really? Does it matter that IE implemented XSL-T, SMIL and other technologies before they became a standard?
Sergey Ilinsky
Congratulations, Microsoft, you made up something which eventually became a standard. You still fail at following existing standards made up by *others* and that's what's been bothering web developers for years now.
Deniz Dogan
I've been lucky enough to use a proprietary server architecture that uses the latest version of TraceMonkey and therefore have been able to use some of these features, but for the vast majority of developers you are absolutely correct. How can something no one is able to use enhance their code? +1
Prestaul
From the JScript blog: `However, we expect that once it is finally approved, the revised ECMAScript standard to be widely and fairly rapidly adopted by browsers. In the meantime, this new specification is already having an impact. For example, in IE8 both the native JSON and the DOM Prototypes features are based upon APIs defined in the ECMAScript Fifth Edition Specification.`. So a few features of ECMAScript 5 are already implemented in IE8, expect more (if not a full implementation) in IE9. So "absolutely nothing" seems rather innacurate.
Andy E
+1 to true for words, however Immutable objects with freeze() and seal() will have security benefits that degrade gracefully. meaning IE will still have security holes
Fire Crow
+1  A: 

"Strict" mode sounded promising in the introduction, but a quick glance at Annex C (page 223) makes me wonder how useful it'll be.

Alan
+2  A: 

The JSON object in section 15.12 looks awesome. That would help, as right now one must rely one either the insecure eval() or some slow pure-JavaScript implementation that you have to include with the rest of your scripts. There's no native support, but this new version will have it.

apphacker
+1  A: 

A lot of what ES3.1 does is actually define already existing behaviour -- things like enumeration order in for (... in ...) ... statements. So to an extent those things won't directly help you (unless a new js engine comes along).

It does also define a few new functions like

* prototype access -- i think through `getPrototype()` or something -- alas this isn't as powerful as `__proto__` present in JavaScriptCore and SpiderMonkey

* The JSON object to provide fast and safe JSON parsing rather than the conflagration of existing techniques

[edit: in response to the person complaining about IE -- i believe IE8 already supports the above features]

olliej
A: 

There is an interesting video about EcmaScript 5. I strongly recommend it.

Elzo Valugi
+1  A: 

John Reisig (the creator of jQuery) has a long post on the new features in ECMA Script 5.

Chris S