In Paul Graham's famous essay, Beating the Averages, he explains how his decision to use Lisp as the backend language for Viaweb helped Viaweb gain a critical competitive advantage, making it the first successful commerial web application. (This happened ages ago: in 1996!) According to Paul, Lisp's conciseness and expressiveness produced a rapid development cycle that helped Viaweb's platform outpace its competition in stability and features. This rewarded Viaweb's founders very generously, as they eventually sold Viaweb to Yahoo for $49 mil(!).
Here's a passage from Paul's essay describing the competitive advantage Lisp gave Viaweb:
What were the results of this experiment [using Lisp]? Somewhat surprisingly, it worked. We eventually had many competitors, on the order of twenty to thirty of them, but none of their software could compete with ours. We had a wysiwyg online store builder that ran on the server and yet felt like a desktop application. Our competitors had cgi scripts. And we were always far ahead of them in features. Sometimes, in desperation, competitors would try to introduce features that we didn't have. But with Lisp our development cycle was so fast that we could sometimes duplicate a new feature within a day or two of a competitor announcing it in a press release. By the time journalists covering the press release got round to calling us, we would have the new feature too.
It must have seemed to our competitors that we had some kind of secret weapon -- that we were decoding their Enigma traffic or something. In fact we did have a secret weapon, but it was simpler than they realized. No one was leaking news of their features to us. We were just able to develop software faster than anyone thought possible.
One can learn a valuable lesson from Viaweb's story: the programming language(s) a startup chooses can have a decisive effect on its business success. Picking a language that fosters developer productivity is critical, because if your competitors use a more productive language, they would eventually have an advantage in the marketplace. In Viaweb, as well as Orbitz's case, Lisp has proven to be the winning language choice. Lisp's combination of power and obscurity has led Paul Graham to think of Lisp as a startup's secret weapon, so Viaweb has never advertised its use of Lisp, fearing Viaweb's competitors would adopt Lisp as well.
Viaweb has actually had another secret weapon that the essay doesn't discuss: great hackers. Viaweb's use of Lisp may have given it a productivity advantage, but even more important than the use of language is the skill of a company's hackers. I'm believe that in most cases, a team of good hackers can beat a team of average hackers even if the good team uses a less productive language.
The same holds even if the good team is smaller than the average team. In fact, the bigger the team, the more management and communications overhead tend to slow down development. Even worse, large teams sometimes become stratified bureaucracies in which hackers are regarded as mere implementors of a the suits' "vision." Depending on the industry, this can be a recipe for mediocrity if not outright failure. For an illustration, look at the rate at which Google, which has an agile, decentralized structure, churns out quality products and compare it to Microsoft's Vista nightmare.
I'd bet Paul and Robert Morris would have made Viaweb a success even if they had written it in a less productive language (maybe even C, which I sadly have to use at my day job) because they are top-notch hackers and because they ran a lean-and-mean, independent operation that gave free reign to their creativity and problem-solving finesse.
All else being equal, though, picking a great programming language can make a big difference for a startup. So, ignoring hackers' skills, what is a (web) startup's ultimate secret weapon? Well, I can't say I know for certain, but I do have some ideas :) Paul Graham thinks it's Lisp, and although I appreciate Lisp's clean syntax, dynamic typing, and great metaprogramming features, I can't say I like the way Lisp code looks (admittedly, the last time I touched Lisp was in college, so I may be oblivious to its wonders). I actually think that a startup's secret weapon arsenal boils down to the following:
- If it's building an "ordinary" CRUD-based webapp and it has good or average hackers, it should go with Ruby on Rails or Python/Django. (haXe will be another appealing option in a few months.)
- If it's building a CRUD-based app or a cutting-edge app that uses advanced Comet techniques like Meebo, and it has very good hackers who aren't scared of functional languages, it should go with Erlang.
Why would a startup need better hackers if it's using Erlang? After all, Erlang is actually a very simple language -- simpler than Ruby. There are two reasons:
- Erlang is a dynamically-typed functional language, which apparently doesn't fit well into developer brains that are conditioned into thinking in Java. Sadly, this is the general case these days.
- Erlang doesn't have as many web development libraries as Rails or Django, so the hackers would need the courage to roll up their sleeves and write their own framework-level code. (Yaws, "The" Erlang webserver, does have some good web development APIs, but not as many as Rails.)
In time, Erlang will have better web development tools. When it happens, I predict that Erlang will become the ultimate startup secret weapon. Why? Because Erlang is a better language than Ruby/Python, especially for building concurrent, distributed applications with scalable, highly-available backends, where Erlang is years ahead of any other language. Even if, hypothetically, the initial development would be somewhat slower with Erlang, Erlang is best positioned to prevent a startup's developers from turning into full-time sysadmins/optimizers once the app becomes popular. This is important because they can spend their time developing new features that give the startup a competitive advantage.
Erlang will get there sooner than you may realize. Stay tuned.