全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 R语言论坛
1312 0
2012-11-22
Which programming language is the most concise?


by David Smith


An expressive programming language allows developers to implement algorithms quickly, by using high-level concepts and leaving the details to the language implementation. The result is clearer, more maintainable code that can be created in less time. (Although shorter code isn't always better, especially when taken to extremes.)
So which programming languages use the least code, when compared on an apples-to-apples basis? At the WolframAlpha blog, Jon McLoon analysed the same algorithms (from the Rosetta Code project) implemented in 14 different languages, and compared the program sizes. Jon used the metrics of lines of code, characters of code, and token count (which ignores varying length of procedure names) to measure program size. According to Jon, the fairest comparison is character count for non-trivial algorithms ("large tasks"), and the results are shown below:
The shortest code on average is produced by programs written in Wolfram's Mathematica. The runner-up isClojure, closely followed by the R language. For comparison, programs written in Python are more than twice the length of equivalent programs in R; programs in C++ are about 4x the length. Read the complete analysis at the link below.
Wolfram Blog: Code Length Measured in 14 Languages



二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群