Approach of new Object methods in ES5

Peter van der Zee ecma at qfox.nl
Fri Apr 16 07:17:36 PDT 2010


On Fri, Apr 16, 2010 at 2:28 PM, Dean Edwards <dean.edwards at gmail.com>wrote:

> On 16 April 2010 13:13, Dmitry A. Soshnikov <dmitry.soshnikov at gmail.com>
> wrote:
>
> > I think that approach used in ECMA-262-5 for new object methods
> contradicts ES nature.
>
> +1
>
> The new API seems quite random. I hope that JavaScript is not turning into
> PHP.
>
>
Indeed. The inconsistency and "hacks" is what drives me away from PHP.

I would prefer going by version and having the programmer specify the
version somehow. Perhaps like a directive.

Pros:
- You can preserve backwards compat without allowing the inconsistency
issues that PHP suffers from.
- If you didn't add the directive, you probably didn't use any features for
which you required a directive

Cons:
- Browsers would have to support multiple implementations to preserve
backwards compat. This con might not be that big a deal looking at the
release frequency of the ecma spec :)
- Coders would have to know about such a directive, they're not used to
requesting a specific version
- What would be the "default" version when no version was requested...

I'm interested whether there are any other alternatives. I'm expecting this
to be shot down, hard ;)

- peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20100416/5f1737cd/attachment-0001.html>


More information about the es-discuss mailing list