Daily Archives: July 6, 2009

Density

July 6, 2009
By

I’ve long been complaining — some would say bitching — about how verbose it is to code in many languages today. In many cases I am sorry witness to people programming in C/C++ or Java and writing thousands upon thousands of lines of code only to end up with a piece of code that coudl easily have been expressed in a denser language in a few hundred lines of code. Today I came across a nice table produced by Larsson Omberg comparing the code required to do some value decomposition in Mathematica, Matlab, and Python. It’s from 2005 but much of this probably still holds for his example.  What we see is the following: Mathematica: 276 lines of code Matlab: 52 lines of code Python: 71 lines of code What we see is a density advantage of 5 times for Matlab and about 4 for Python over Mathematica. And Mathematica is already a dense language. Imagine coding the same solution in C/C++ or Java? We’d probably see at least twice as much code over Python for C/C++ and Java. That means the Mathematica code would be 10 times as dense, an order of magnitude. What that means is that on

Read more »

Musings

A blog of my musings. Some folks find it interesting and so I continue. Hopefully it will remain fairly interesting. At worst, it'll keep me writing orthogonally to my day job.

Month at a Glance

July 2009
M T W T F S S
« Jun   Aug »
 12345
6789101112
13141516171819
20212223242526
2728293031  

StatPress

Visits today: 11
Total page views: 88664