Java与JavaScript | 差异与流行

Java vs JS

As of 2019, both Java and JavaScript are very powerful and are dominating in their respective domains. Although they are indeed incomparable in terms of their applications, we'll try to draw a very logical and unbiased comparison between the two. We'll look at what they both do, how they're both similar and how they're not.

截至2019年,Java和JavaScript都非常强大,并在各自的领域中占主导地位。 尽管它们的应用确实无法比拟,但我们将尝试在两者之间进行非常合乎逻辑且无偏见的比较。 我们将研究它们的作用,它们之间的相似性和不相似性。

What they aren't?

他们不是什么?

Java vs JS

First things first, they aren't the same. JavaScript is not a subset or variation of Java. Though it is natural for such confusion to arise tech people or newbie programmers should be well aware that both are completely different, with absolutely no relation to each other except for the general syntax which is mostly similar in all modern languages. The name subset in both is merely a historic coincidence. Brendan Eich of Netscape, the Legend who created this Legendary language JavaScript casually called it LiveScript. This was around in 1990. This was indeed a breakthrough for programmers as it was purely evaluated on run time and one could use it to directly interact with browsers. However, around the same time, Java was getting immensely popular. So they decided to call it JavaScript so that people pay some heed to JS while being in the misconception that it is an up-gradation of Java.

首先,他们是不一样的。 JavaScript不是Java的子集或变体 。 尽管这样的混乱很自然地出现,但是技术人员或新手程序员应该清楚地知道两者是完全不同的,除了在所有现代语言中大多数都是相似的通用语法外,彼此之间完全没有关系。 两者中的名称子集仅是历史上的巧合。 Netscape的Brendan Eich(传奇人物)创建了这种传奇性语言JavaScript,并随便将其称为LiveScript。 这是在1990年左右。对于程序员来说,这确实是一个突破,因为它仅在运行时进行评估,并且可以使用它直接与浏览器进行交互。 但是,大约在同一时间,Java变得非常流行。 因此,他们决定将其命名为JavaScript,以便人们误以为JS是Java的升级版,从而引起人们的注意。

2019年的受欢迎程度 (Popularity in 2019)

Java vs JS

The above graph shows us a clear comparison in terms of the popularity of languages in 2019. JavaScript is the most popular language as of today. Its usage has grown immensely and it's being used for almost everything today. However, the popularity of JavaScript should not be reasoned out for its superiority over Java.

上图为我们显示了2019年语言受欢迎程度的清晰比较。JavaScript是当今最受欢迎的语言。 它的用途已大大增加,如今已用于几乎所有事物。 但是,不应因为Java的优越性而推断出JavaScript的流行。

性能 (Performance)

Java vs JS

Java is a compile-time language and therefore needs a compiler, unlike Js which is executed at run time. You need a virtual machine to execute your Java code whereas in Js you only need your browser. However, a technical comparison shows that Java defeats JavaScript in terms of performance.

Java是一种编译时语言,因此需要编译器,这与在运行时执行的Js不同。 您需要一个虚拟机来执行Java代码,而在Js中,您仅需要浏览器。 但是,一项技术比较表明,Java在性能方面击败了JavaScript。

In addition to this, only recently JavaScript has got Object-Oriented Programming directly attached to it. Before that, developers and programmers would have to manipulate JavaScript to make it work like an Object-Oriented Programming Language. Java, on the other hand, was born for OOPS much like C++.

除此之外,直到最近JavaScript才直接附加了面向对象编程。 在此之前,开发人员和程序员将不得不操纵JavaScript,以使其像面向对象的编程语言一样工作。 另一方面,Java就像OO ++一样为OOPS而生。

用途 (Uses)

Java is used for server-side development and native applications for Android. JavaScript is used for front-end web development, creating animations on the web and now also for server-side development using NodeJS.

Java用于服务器端开发和Android的本机应用程序。 JavaScript用于前端Web开发,在Web上创建动画,现在也用于使用NodeJS进行服务器端开发。

Any student new to the programming arena will be intrigued by what they're both capable of achieving. However, it is purely a personal choice as to which language will be the best for anyone.

任何一个编程领域的新手都会对他们俩都有的成就感兴趣。 但是,对于哪种语言最适合任何人,这完全是个人选择。

判决 (Verdict)

I'd say JavaScript is clear winner, but then I promised I wouldn't be biased.

我会说JavaScript无疑是赢家,但后来我保证我不会偏见。

翻译自: https://www.includehelp.com/code-snippets/java-vs-javascript.aspx

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值