Jonathan Edwards, in The Myth of the Super Programming Language makes the extraordinary claim that language choice makes little difference.
There is no reason to believe that language choice makes a big difference. People have been doing studies for decades, and there are no reproducible strongly positive results. The burden of proof is on the poster, who is making a surprising claim.
To be fair, I believe he actually intended to single out Haskell and Lisp and state that it is impossible to get an order of magnitude increase in effectiveness. I’m not sure he is right there either, but I’ll dispute the actual claim he made.
Proof By Obviousness
First of all, there are studies that show that different languages required a different amount of code to implement a certain amount of functionality. Take a look at the language / function point here. Smalltalk (28 lines/fp) is more than 5 times better than C (148 lines/fp) in this metric. And comments about APL not-withstanding, code that you don’t write takes the least time.
Second of all, it is hardly a surprising claim. In the leap from Assembler to C, I’m obviously going to save programming time by not having to write code to push my parameters on to the stack every time I want a function.
Moving from C to Java I don’t have to write [so much] memory management code. Java to Perl, I don’t have to specify my data structures ahead of time.
Each language change, there is code that I just don’t have to write any more1. How can that not make a difference?
I’m not smart enough to get Haskell. If I had to guess, I’d say that Jonathan isn’t either, and is mildly upset that folks can out-perform him by choosing these languages.
Perl is the most super programming language I know.
And just to demonstrate the amount of code I need to specify a simple data structure that I get for free in perl, here is some C++.
struct MyData { vector<string> list; map<string, string> dict; }; MyData data; if (data.dict.find("a") == data.dict.end()) { data.dict.insert(make_pair("a", "b")); } data.list.push_back("text"); // data.list.push_back(1.5);
The perl is clearly terser. Is it less understandable (assuming you know both languages)? No way – it’s clearer.
And I know I’ve been kinda mean with the heterogenous list.
my %data; $data{dict}->{a} = 'b' unless exists $data{a}; push @{$data{list}}, 'text'; push @{$data{list}}, 1.5; #![]()
Choice Of Language Isn’t The Most Important Factor
As long as you don’t choose something crazy, like Intercal, or Assembler.
The important thing is that there are libraries that solve the majority of your problem. As many people have pointed out, a lot of development these days is gluing together libraries. For me, as much as 95% of the systems I write are third-party libraries.
And my favourite example of something I wrote that would have been much longer in either Perl or C++ is my Emacs Database Mode. Emacs Lisp isn’t a great language, although it is good enough, but for certain problems it has some amazing libraries.
1. Of course, there are trade-offs.
Both of you guys suffer from the problem that you seem to be oblivious to the context of the problems themselves.
Libraries aren’t important for many problem domains.
I really wish bloggers would be responsible engineering-wise and accept that context exists.
Hi Anonymous,
Can you share an example of a problem where libraries wouldn’t help?
Thanks
Anonymous is probably talking about certain corporate environments where modules are forbidden due to high level of NIH syndrome.
Hi Gabor,
Even then, they are probably building on top of perl core modules, C or C++ stdlib or whatever the Java standard library is called depending on their choice of language no?
Anonymous could also be referring to things like Google App Engine where you have to use Python or Java.
iPad, iPhone where you must use Objective-C (at least to make native apps)
SAP where you have to use ABAP
The Linux Kernel where you have to use C.
and so on…
… hah, i forgot and emacs where you have to use elisp
Hi Example,
In the examples you gave, you’re forced to use a particular language. But the libraries provided (at least in Linux Kernel and Emacs, I’m not familiar with the others) are still more important than the language itself.
I mean, with pure emacs lisp sans libraries, you can do… not a lot, at least without a huge amount of effort. With emacs lisp + emacs core libraries, you can effortlessly write an amazing text editor (:-)), or a great interface to Sybase, or a stock subscriber, or…
Anonymous seemed to imply that cases exist where it doesn’t matter if you have no libraries at all. Trival examples such as hello world and fibonacci aside (and the C implementation of hello world uses stdio), I struggle to think of any.
I understand both sides and from my point of view you can simply say that the programmer had to choose the language which allows him to solve as problem in the best way.
Since the programmer, the problem and the best way can vary the best language can vary.
Best can mean a lot of things. Fast (C, Assembly), safe (Ada, BitC), shortest (Perl among others), readable (depends on the programmer), portable (C (because a C compiler is available virtually everywhere) or interpreted languages (because it runs, where the VM/interpreter runs)) code to name a few examples.
There is a reason, why there are multiple programming languages.
Hi Tuff,
I completely agree with this statement.
However, in many (most) corporate environments, the programmer doesn’t have a free choice of language. I think we have around 8 acceptable languages at my firm, and my team considers 3 of these to be acceptable. If I used one of the other 5, I wouldn’t be popular
I think I am getting side-tracked from one of my main points. And that is, sometimes you will be working on a project that doesn’t have a library available such as a device driver for a brand new piece of hardware (yes, I finally thought of one).
The other 99% of the time, more important than the language is the libraries available. Even C has data structure libraries, socket libraries, event libraries, threading libraries, xml libraries, database libraries, etc. And because everything else is written in C, they have access to all of the C libraries, plus all of their own libraries.
Language selection doesn’t matter (much) when your problem isn’t addressed by any existing languages/libraries.
The examples I can think of fall into three categories; interacting with multiple poorly designed legacy systems, algorithmic research and limited platforms (embedded systems, working on GPUs, parallel computing back in the days when you had to start with sockets, etc). The difficulty arises from the operations necessary to complete the tasks, fundamentally complex algorithms. Once you’re in that space everything else (containers, flow control, syntax) adds a relatively small fixed cost, you pay it once and then get on with the actual work.
There are plenty of actually hard problems to solve, that’s the basis of Computer Science in my mind. You can find a plethora of examples in the “The Art of Computer Science” series. Yes, much of that work is now available in just about any decent language, but I think my point is plain.
I think that this is the point the author of parent article was trying to get across. He diluted the message by being needlessly inflammatory and occasionally wrong. It would have been a much better piece if it was shorter.
At the risk of making the same mistake, I can’t believe you (Jared) linked to that function point analysis as support. I don’t think much of the technique to begin with and that was a great example of why no one should. They included HTML (Why not include photoshop while you’re at it?) and SQL Forms beat everything else by nearly a factor of 2. Ugh.
[...] Jared contests the claim that the choice of a language ultimately makes little difference. [...]
Hi AnonymousCoward,
I pretty much disagree with everything you wrote there. I’ll probably elaborate in a future blog post.
Hi Jared,
Glad to hear it, I subscribe to your RSS and look forward to your thoughts. Since I have another shot at making myself clear (accidentally posting whilst editing didn’t help my case), I might as well use up a bit more of your space and attention. I’m referring to problems where there’s very little exploratory programming to be done, so the inherent agility of various dynamically typed languages doesn’t help very much.
If there isn’t exploratory programming to be done, does that mean that libraries exist that solve most of your problem? In that case, use the language that provides those libraries.