Friday, May 9, 2008

Is Functional Programming the new Python?


Back in 2004 Paul Graham wrote an essay on the Python Paradox:

if a company chooses to write its software in a comparatively esoteric language, they'll be able to hire better programmers, because they'll attract only those who cared enough to learn it. And for programmers the paradox is even more pronounced: the language to learn, if you want to get a good job, is a language that people don't learn merely to get a job.


Some tentative support for this theory comes from a study of programming languages done in 2000. The same task was given to over 80 programmers. The chart shows how long they took. Obviously the average for some languages was a lot less than for others, but the interesting thing for the Python Paradox is the variability. Java had huge variability: one developer took over 60 hours to complete the task. Meanwhile the Python developers were the most consistent, with the lowest variance as a percentage of the mean. I suspect (but can't prove) that this was because of the kind of programmers who wrote in Java and Python back in 2000. Java was the language of the Web start-up and the dot-com millionaire, but Python was an obscure open source scripting language. The Pythonistas in this study didn't learn it to get a job, but many of the Java programmers did.

But if this study was repeated today I bet the spread for Python would be a lot larger. Maybe still not as big as Java, but more like C++ or Perl. Because today you can get a good job writing Python. A quick check of jobs on dice.com found 1450 Python jobs against 7732 C++ jobs and 15640 jobs for Java. Python hasn't taken over the world, but the jobs are there.

So the smart employers and developers need something new to distinguish themselves from the crowd, and it looks like functional programming might be it. Programming Reddit carries lots of cool stuff about Haskell, and job adverts are starting to list a grab-bag of functional languages in the "would also be an advantage" list. For instance:
- Programming experience with more esoteric and powerful languages for data manipulation (Ruby, Python, Haskell, Lisp, Erlang)
So it looks like the with-it job-seekers and recruiters may be starting to use functional programming to identify each other, just as they used Python up to 2004.

Update: Oops. I just remembered this post which started me thinking along these lines.

6 comments:

Eris said...

Interesting observation. I agree with your observation about Python, but honestly "functional languages"? Python is essentially Scheme hacked up with relatively normal syntax.

It's not as pure as Scheme, but you can perform nearly any functional task in Python. As much as I like LISP, it's a developed taste.

Anonymous said...

Great insight. Any chance of a repeat?

Anonymous said...

Eris,

Python and Scheme have a couple big differences in semants (in addition to syntax), the main one of which is Python's reliance on class-based OO.

James Iry said...

Eris, Python is a class based, single dispatch, object oriented language with dynamic meta programming facilities. Python makes a small nod towards functional programming with one line lambdas. Tail call optimization isn't mandatory (but can be added).

Scheme is a functional programming language with the awesomely powerful call-with-current-continuation and hygienic syntactic metaprogramming (macros). Tail call optimization is mandatory.

Whoever told you that Python and Scheme are the same was seriously confused.

Unknown said...

Saltmarh Media is organizing this Great Indian Developer Summit event in Bangalore. This in a way will be a boost for the Software Developing Industry. It covers the topics like .Net, Java and Richweb and has 1 day workshop at the end as well. Any one attneding this event?

Register @ www.developersummit.com

Juho Vepsäläinen said...

Nice point! It seems Python is getting more mainstream. Some current figures from Dice:
* C++ - 6248
* Java - 16920
* Python - 3017
* Ruby - 1767
* PHP - 3303

Haskell gave mere 19 but that's better than nothing I guess.

It seems to me Python is catching up with C++. Java has increased in popularity as well. I was a bit surprised by PHP. I thought it would be more popular than that. Perhaps people are moving to other languages?