Ruby,Python不能威胁到Java的13个理由 博客分类: 编程技术 JavaRubyPythonGroovyScala
程序员文章站
2024-02-16 21:52:34
...
最近,danielstoner发表了一篇题为13 reasons why Ruby, Python and the gang will push Java to die… of old age的文章。文中作者的观点是:目前这些XX语言都不足以威胁到Java,Java真正的危险不是来自外部,而是其本身。作者通过列举一些数据并进行分析得到了13个理由来支持自己的结论。
首先,作者从TIOBE上公布的2008年5月语言排行榜的数据得到一个有趣的事实:
What I find significant here is the huge share the “C like syntax” languages have.
C (15.292) + C++ (10.484) + Java (20.176) + C# (3.963) = 49.915%
This means 4 languages get half of all the attention on the web.
If we add PHP (10.637) here (somehow uses a similar syntax) we get 60.552%
可见,“类C”语言占统治地位。由此作者得到第一个理由:
我们再来看看这些“挑战者”所占的份额:
它们被关注度的总和都没有超过Visual Basic所占的百分比:10.782%。作者归纳出第二个原因:
然后,作者分析了这几年来各种主流语言被关注程度的趋势
从图中可以看到,这些变化趋势从整体上看都比较平稳。并没有出现“语言暴发户”,也没有出现“一夜暴亡”的。这就是作者的第三个理由:
然后,作者分析了另一个关于编程语言流行程度的网站上给出的一些数据。
首先,作者从Freshmeat.net与Google Code上使用各种语言建立项目数目的得到:
余下的就不一一说明了,直接列举之:
Reason number 5: Challenger languages communities don’t do a good job at attracting programmers from established languages. Telling to somebody why she is wrong will most likely create a counter reaction not interest.
Reason number 6: There is no great incentive to switch to one of the challenger languages since gaining this skill is not likely to translate into income in the near future.
Reason number 7: The new languages don’t introduce an earth shattering improvement in the life of most of the programmers and projects.
Reason number 8: There is no killer application on the horizon. This means new languages compete in old markets with established players.
Reason number 9: None of these new languages has a powerful sponsor with the will and the money to push them on the market. Powerful sponsor translates in investment in the libraries - see Java. All these new languages are born in universities and research institutes or are coming from very specific niche domains.
Reason number 10: Most of these languages lingered around too much without stepping decisively into the big arena.
Reason number 11: “Features” that look and are dangerous for big projects. Since there are not a lot of big projects written in any of these languages it is hard to make an unbiased evaluation. But bias is in the end a real obstacle for their adoption.
Reason number 12: Unnatural concepts (for majority of programmers) raise the entry level. Functional languages make you write code like mathematical equations. But how many people actually love math so much to write everything in it? Object oriented languages provide a great advantage: they let programmers think about the domain they want to model, not about the language or the machine.
Reason number 13: Lack of advanced tools for development and refactoring cripple the programmer and the development teams when faced with big amounts of lines of code.
作者还对几种以“Java挑战者”姿态出现的语言进行了分析:
最后,作者提出:
首先,作者从TIOBE上公布的2008年5月语言排行榜的数据得到一个有趣的事实:
引用
What I find significant here is the huge share the “C like syntax” languages have.
C (15.292) + C++ (10.484) + Java (20.176) + C# (3.963) = 49.915%
This means 4 languages get half of all the attention on the web.
If we add PHP (10.637) here (somehow uses a similar syntax) we get 60.552%
可见,“类C”语言占统治地位。由此作者得到第一个理由:
引用
Reason number 1: Syntax is very important because it builds on previous knowledge. Also similar syntax means similar concepts. Programmers have to make less effort to learn the new syntax, can reuse the old concepts and thus they can concentrate on understanding the new concepts.
我们再来看看这些“挑战者”所占的份额:
引用
Python (4.613) + Ruby (2.851) + Lisp/Scheme (0.449) + Lua (0.393) + SmallTalk (0.138) +
Haskell (0.137) + Groovy (0.131) + Erlang (0.110) + Caml (0.090) + Scala (0.073) = 8.985%
Haskell (0.137) + Groovy (0.131) + Erlang (0.110) + Caml (0.090) + Scala (0.073) = 8.985%
它们被关注度的总和都没有超过Visual Basic所占的百分比:10.782%。作者归纳出第二个原因:
引用
Reason number 2: Too much noise is distracting. Programmers are busy and learning 10 languages to the level where they can evaluate them and make an educated decision is too much effort. The fact that most of these languages have a different syntax and introduce different (sometimes radically different) concepts doesn’t help either.
然后,作者分析了这几年来各种主流语言被关注程度的趋势
从图中可以看到,这些变化趋势从整体上看都比较平稳。并没有出现“语言暴发户”,也没有出现“一夜暴亡”的。这就是作者的第三个理由:
引用
Reason number 3: Lack of pressure on the programmers to switch. The market is pretty stable, the existing languages work pretty well and the management doesn’t push programmers to learn new languages.
然后,作者分析了另一个关于编程语言流行程度的网站上给出的一些数据。
首先,作者从Freshmeat.net与Google Code上使用各种语言建立项目数目的得到:
引用
Reason number 4: Challenger languages don’t seem to catch momentum in order to create an avalanche of new projects started with them. This can be again due to the fact that they spread thin when they are evaluated. They are too many.
余下的就不一一说明了,直接列举之:
引用
Reason number 5: Challenger languages communities don’t do a good job at attracting programmers from established languages. Telling to somebody why she is wrong will most likely create a counter reaction not interest.
Reason number 6: There is no great incentive to switch to one of the challenger languages since gaining this skill is not likely to translate into income in the near future.
Reason number 7: The new languages don’t introduce an earth shattering improvement in the life of most of the programmers and projects.
Reason number 8: There is no killer application on the horizon. This means new languages compete in old markets with established players.
Reason number 9: None of these new languages has a powerful sponsor with the will and the money to push them on the market. Powerful sponsor translates in investment in the libraries - see Java. All these new languages are born in universities and research institutes or are coming from very specific niche domains.
Reason number 10: Most of these languages lingered around too much without stepping decisively into the big arena.
Reason number 11: “Features” that look and are dangerous for big projects. Since there are not a lot of big projects written in any of these languages it is hard to make an unbiased evaluation. But bias is in the end a real obstacle for their adoption.
Reason number 12: Unnatural concepts (for majority of programmers) raise the entry level. Functional languages make you write code like mathematical equations. But how many people actually love math so much to write everything in it? Object oriented languages provide a great advantage: they let programmers think about the domain they want to model, not about the language or the machine.
Reason number 13: Lack of advanced tools for development and refactoring cripple the programmer and the development teams when faced with big amounts of lines of code.
作者还对几种以“Java挑战者”姿态出现的语言进行了分析:
引用
For scripting Python has potential, huge potential. But it has to do something about the indentation fetish to be able penetrate the big project market. Without that the web looks PHPish.
Ruby is elegant but alien. I saw its syntax described like “the bastard son of Perl” (just google it). Its new popularity is based not on the language itself but on a framework (Rails) that can be reproduced in other languages even if with less elegance. Struts 2 attempts just that.
Scripting languages (Groovy, Rhino…) on top of Java and the JVM are interesting but they will never be primadonnas. They cannot compete with Java because they are slower. They can be useful when scripting a Java application is a desirable feature (VBA is an excellent tool for Microsoft products and other Windows products and it pushed Visual Basic up the scale).
Scala has a lot of good cards. Building on the JVM, familiar syntax, huge inherited library, can be as fast as Java on the JVM… But where is the sponsor and where is the killer application in a shifting market?
Ruby is elegant but alien. I saw its syntax described like “the bastard son of Perl” (just google it). Its new popularity is based not on the language itself but on a framework (Rails) that can be reproduced in other languages even if with less elegance. Struts 2 attempts just that.
Scripting languages (Groovy, Rhino…) on top of Java and the JVM are interesting but they will never be primadonnas. They cannot compete with Java because they are slower. They can be useful when scripting a Java application is a desirable feature (VBA is an excellent tool for Microsoft products and other Windows products and it pushed Visual Basic up the scale).
Scala has a lot of good cards. Building on the JVM, familiar syntax, huge inherited library, can be as fast as Java on the JVM… But where is the sponsor and where is the killer application in a shifting market?
最后,作者提出:
引用
The danger for Java doesn’t come from outside. None of these new (actually most of them are pretty old) languages have the potential to displace Java.
The danger for Java comes from inside and it is caused by too many “features” making their way into the language and transforming if from a language that wanted to keep only the essential features of C++ into a trash box for features and concepts from all languages.
The danger for Java comes from inside and it is caused by too many “features” making their way into the language and transforming if from a language that wanted to keep only the essential features of C++ into a trash box for features and concepts from all languages.