Python Authors: Trevor Parsons, Lacey Thoms, Jayaram Krishnaswamy, Sandi Mappic, RealWire News Distribution

Blog Feed Post

Which programming language is the most concise?

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 is Clojure, 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

Read the original blog entry...

More Stories By David Smith

David Smith is Vice President of Marketing and Community at Revolution Analytics. He has a long history with the R and statistics communities. After graduating with a degree in Statistics from the University of Adelaide, South Australia, he spent four years researching statistical methodology at Lancaster University in the United Kingdom, where he also developed a number of packages for the S-PLUS statistical modeling environment. He continued his association with S-PLUS at Insightful (now TIBCO Spotfire) overseeing the product management of S-PLUS and other statistical and data mining products.<

David smith is the co-author (with Bill Venables) of the popular tutorial manual, An Introduction to R, and one of the originating developers of the ESS: Emacs Speaks Statistics project. Today, he leads marketing for REvolution R, supports R communities worldwide, and is responsible for the Revolutions blog. Prior to joining Revolution Analytics, he served as vice president of product management at Zynchros, Inc. Follow him on twitter at @RevoDavid