English 中文(简体)
Java是否像在《O Reilly Javascript patternss书》中所提到的那样为关闭和匿名职能做了更好的描述?
原标题:Is Javascript any better than before as mentioned in the O Reilly Javascript Patterns book for closures and anonymous functions?
  • 时间:2011-10-01 10:36:50
  •  标签:
  • javascript

This is a quote from the O Reilly Javascript Patterns book:

JavaScript is also an unusual language. It doesn’t have classes, and functions are first class objects used for many tasks. Initially the language was considered deficient by many developers, but in more recent years these sentiments have changed. Interestingly, languages such as Java and PHP started adding features such as closures and anonymous functions, which JavaScript developers have been enjoying and taking for granted for a while.

并且如此。 我确实不理解 Java字在以前是如何被视为“不足”的,现在不是,因为 Java或PHP等其他语言增加了关闭和匿名功能? 他们只是通用计算概念吗? Aren t 可用其他语文提供,如Ruby? 因此,我没有真正知道 Java字现在如何不“有缺陷”,因为 Java和购买力平价增加了关闭和匿名功能,因为它们的特点? 为什么如此?

最佳回答

我认为,它提到的是,在过去,许多开发商认为 Java文是一种玩具语言,只是利用它做诸如验证等迅速的网络调查任务,而没有同时了解该语言如何真正发挥作用。

近年来,贾瓦文的隐性特征,如封闭、传承等,已经到了顶峰,人们现在将贾瓦文视为一种真正的语言。

因此, Java文从来不是真正的“缺陷”,但人们可能认为,它是由于他们对语言的误解。

问题回答

I personally think it s a poor editing job.

The paragraph should have read (bold addition is mine and is just a suggestion on how to read it):

JavaScript is also an unusual language. It doesn’t have classes, and functions are first class objects used for many tasks. Initially the language was considered deficient by many developers, but in more recent years these sentiments have changed due to a better and more uniform browser support, extensive work done by various ECMA editions and evolution of various JavaScript frameworks. All, or much, of that change is a direct result of ever-expanding movement of software products to the Web and growing demand for a lightweight language for mobile applications (this one can be somewhat argued).

Interestingly, languages such as Java and PHP started adding features such as closures and anonymous functions, which JavaScript developers have been enjoying and taking for granted for a while.

多年来,人们知道, Java本只是一种浏览器语言,因为(简单)特征要求比超文本和中文本安全局更具活力和/或灵活性。

几年来, Java文成为一种语言和平台,提供了强大的图书馆,也消除了某些交叉浏览器的不一致之处。 随着这些图书馆的兴起,社区实际上只开始学习如何使用贾瓦伦古典的一些强大概念,如关闭和传承。

They have not been widely used nor known even to JavaScript developers before, since JavaScript is in its basics very simple language, and most developers didn t even have to learn it as you d learn Python, C or Java - all they had to look at were tutorials and many of them didn t include these language features.

简言之广,Java(正式称为欧洲马典)已经收到几期新版,这些版本的特征已经添加到语言本身中:Latest edition(正在开发之中)将引入一些激进的新版本(认为是班级、模块系统、导器、薄膜等),因此,联合材料将变得更好、更有条理、更便于使用。

贾瓦文还在服务器(Node.js)方面引起公众的欢迎,并证明是一种容易、快捷和足够强大的语言,可以做(几乎)任何工作。 臭名昭著的臭名昭著的 abuses本可能受到广泛滥用。 这不是新鲜的,许多语言有合成图书馆,但是,正如瑞安·达尔在他最早发表的讲话之一时所说的那样,联合文件perfect<>em>。 这主要是因为封锁和其他概念。

因此,最后的答案是,你所引述的书的作者没有表达过他的想法,或者说是错的。 它是一种 to语,意味着用于今天这种各种使用案例。 但是,正如 Java或PHP所做的那样,它也发生了变化(登机忘记PHP公司没有获得OOP的支持,这种支持现在似乎非常明显,直到5月。 其他语言只是收集了 good证明对某些使用案例更为有效的好消息。 总的来说,我的想法是, Java本Script从一开始就被适当使用,而它被称作是不足的。 如今,开发商有机会探讨其广度。





相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.