即将发生的JavaScript语言更改 [英] Upcoming Changes to the JavaScript Language

查看:69
本文介绍了即将发生的JavaScript语言更改的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

即将发生的JavaScript语言更改(由Google提供)

http://youtube.com/watch?v=-yDS1eGfuWQ

我非常喜欢这个演示文稿。


如果他们能够在PHPAS版本4和5之间获得与ECMAScript相同的改进,那么他们就得到了我的祝福。


具体来说,在快速本机代码中实现的标准ECMAScript库的可用性将是一项非常有用的改进。

查看标准PHP库(SPL)的示例。

Upcoming Changes to the JavaScript Language (presented by Google)

http://youtube.com/watch?v=-yDS1eGfuWQ

I really enjoyed this presentation.

If they can get the same improvement in ECMAScript as has already been
achieved between PHP versions 4 and 5, then they have my blessings.

Specifically, the availability of a Standard ECMAScript Library
implemented in fast native code would be a TREMENDOUS IMPROVEMENT.
Check out the Standard PHP Library (SPL) for an example.

推荐答案

Evertjan。在2007年12月3日上午6:14发表以下内容:


< snip>
Evertjan. said the following on 12/3/2007 6:14 AM:

<snip>

= 1 = <单独的运算符用于添加和连接。

[新运算符:+ \和& \,任何人都有更好的主意吗? ]

例如:

=====

alert(''1''+ \''''''); // 3

alert(1& \ 2); // 12

alert(''1''+ \ 2); // 3

alert(1& \'''''); // 12
=1=
Seperate operators for adding and concatenating.
[new operators: +\ and &\, anyone a better idea? ]
example:
=====
alert( ''1'' +\ ''2'' ); // 3
alert( 1 &\ 2 ); // 12
alert( ''1'' +\ 2 ); // 3
alert( 1 &\ ''2'' ); // 12



如何使类型转换规则与现在的
不同?无论哪种方式,如果你有混合变量类型你将要b / b
必须进行类型转换,所以改变运算符不会改变它。

How would that make the type converting rules any different than they
are now? Either way, if you have mixed variable types you are going to
have to have type conversion so changing the operator won''t change that.


=====


= 2 =

改进变量范围

例如:

=====

var a = 1;

{

var a = 2;

警报(a); // 2

};

alert(a); // 1

=====
=====

=2=
Improved scoping of variables
example:
=====
var a = 1;
{
var a = 2;
alert(a); // 2
};
alert(a); // 1
=====



这不是一个大问题。它也会破坏网上已有的大量应用程序

。如果你想超出当前范围并改变一个

变量,只需删除var并继续。


< snip>

That isn''t a big issue though. It would break a ton of apps already on
the web as well. If you want to go outside the current scope and alter a
variable, simply drop the var and go on.

<snip>


= 6 =

废除数字文字的八进制解析。
=6=
Octal parsing of numeric litterals shoud be abolished.



为什么?


-

兰迪

机会有利于准备好的思想

comp.lang.javascript常见问题 - http ://jibbering.com/faq/index.html

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/


文章< Xn ******* *************@194.109.133.242> ;,

" Evertjan。" < ex ************** @interxnl.netwrote:
In article <Xn********************@194.109.133.242>,
"Evertjan." <ex**************@interxnl.netwrote:
www.gerardvignes.com 于2007年12月2日在comp.lang.javascript中写道
www.gerardvignes.com wrote on 02 dec 2007 in comp.lang.javascript:

即将发生的JavaScript语言变更(由Google提供)

http://youtube.com/watch?v=-yDS1eGfuWQ


我非常喜欢这个演示文稿。
Upcoming Changes to the JavaScript Language (presented by Google)

http://youtube.com/watch?v=-yDS1eGfuWQ

I really enjoyed this presentation.



有趣。


但是我不同意使Javascript成为强类型语言。

只是在预编译语言程序员的脑海中,

这对于解释或运行编译语言也是有益的

。让他们首先解释一下原因。

它将减少错误的论点仅适用于经验丰富的预编译语言程序员类型的js无经验的程序员。


它可以减少内存需求的真正理由

在这个时代并不重要,imho。


=========================================


我希望JS的几个附录是:


= 1 =

单独的运算符用于添加和连接。

[新运营商:+ \和& \,谁有更好的主意? ]

例如:


Interesting.

However I do not agree to making Javascript a strong typed language.

It is just in the mind of precompiling language programmers,
that that would be beneficial to intepreted or runtimecompiling languages
too. Let them first explain why.

The argument that it will reduce errors is only true for js inexperienced
programmers of the strongtyped precompiling language programmer type.

The true argument that it could reduce memory need
is not that important in this day and age, imho.

=========================================

The few addendums to JS I would like are:

=1=
Seperate operators for adding and concatenating.
[new operators: +\ and &\, anyone a better idea? ]
example:



有什么问题。就像在PHP中一样?由于我在

js和PHP中做了很多东西,我宁愿收敛。

What''s wrong with . just like in PHP? Since I do a lot of stuff in both
js and PHP, I would prefer the convergence.


Tim Streater在12 /上说了以下内容3/2007 6:41 AM:
Tim Streater said the following on 12/3/2007 6:41 AM:

文章< Xn ******************** @ 194.109.133.242>,

" Evertjan。" < ex ************** @ interxnl.netwrote:
In article <Xn********************@194.109.133.242>,
"Evertjan." <ex**************@interxnl.netwrote:



< snip>

<snip>


> = 1 =
分离运算符以添加和连接。
[新运算符:+ \和& \,任何人一个更好的主意? ]
例如:
>=1=
Seperate operators for adding and concatenating.
[new operators: +\ and &\, anyone a better idea? ]
example:



有什么问题。就像在PHP中一样?由于我在

js和PHP中做了很多东西,我宁愿收敛。


What''s wrong with . just like in PHP? Since I do a lot of stuff in both
js and PHP, I would prefer the convergence.



我一直认为,对于程序员定义的变量,有一个

前导字符是一个好主意,就像PHP

的确如此。这将允许语言中的新关键字,而不必担心破坏现有应用程序。我不能肯定地说这就是为什么

PHP做到了,但是为什么他们这样做是令人信服的论据。

-

Randy

机会有利于准备好的心灵

comp.lang.javascript常见问题 - http://jibbering.com/faq/index.html

Javascript最佳实践 - http://www.JavascriptToolbox.com/bestpractices/


这篇关于即将发生的JavaScript语言更改的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆