I just read a paper from Ericsson about Productivity and Quality, where they compare Erlang and C++, and guess what… erlang rules with 4 to 10 times less code and less errors!!! You can read the full paper here, but i copy paste some of the conclusions :
“Comparisons between Ericsson-internal development projects indicate similar line/hour
productivity, including all phases of software development, rather independently of which
language (Erlang, PLEX, C, C++ or Java) was used. What differentiates the different
languages then becomes source code volume.
Some concrete comparisons of source code volume have been made, as applications
written in C++ have been rewritten in Erlang, resulting in a ten-fold reduction in the
number of lines of uncommented source code. Other comparisons have indicated a four-
fold reduction. A reasonable conclusion is that productivity increases by the same factor,
given the same line/hour programmer productivity.
When measuring product quality in number of reported errors per 1000 lines of source
code, the same relationship seems to exist: similar error density, but given the difference
in code volume, roughly 4-10 times fewer errors in Erlang-based products.
Furthermore, experiences from maintaining some Erlang-based products in the field
indicates that error corrections usually do not give rise to unwanted side-effects. This is in
line with what one would expect from using a mostly side-effect free declarative
language.
These comparisons do not pretend to hold up to scientific scrutiny, but they are collected
from indicators which show a rather consistent pattern. They also seem consistent with
opinions offered by non-Ericsson developers [one2one],[sendmail].
While AXD 301 consists of programs written in C, C++ and Java as well as Erlang, and
each language is used where it fits best, practically all the complex work is done in
Erlang. This is usually decided by the designers themselves – many of our most skilled C
programmers prefer Erlang for complex tasks, and consider it the obvious choice for
anything that involves concurrency or distribution.
Finally, we have seen that programmers – even those with no previous exposure to
functional languages – learn Erlang quickly, and become productive within a matter of
weeks.”
I had exactly the same feeling when started to code erlang comparing to my previous most used languages, Java and PHP.