QuicksearchOuter LandsBlogs I ReadSyndicateCategories |
Occupying a Niche is not FailureSunday, March 11. 2007
Recently I stumbled across a blog entry about "the impending Ruby fracture" by David Pollak, which serves only as the catalyst for this post. Specifically, the belief that "Ruby needs to address the needs of the other 90% of the market," with that 90% supposedly being enterprise customers.
I'm very interested in language design, in part motivated by my professional use of PHP and all the things the language doesn't let a sufficiently advanced developer express. PHP is not far up the scale from, say, BASIC in terms of raw, screaming power. Yet PHP is one of the most popular languages on the Web. I'm not even sure anyone besides ISPs offer static-only hosting anymore. Java is also fairly popular and widely-deployed in the enterprise world and its buzzwords like SOA and SDO. Ruby has been catapulted into fame based on Rails, with the slogan, "web development that doesn't hurt." Why is it that languages like PHP and Java become so popular? Is there really some inherent enterprise-unfriendliness to Ruby or Rails which limits its uptake? Why is it the case that "worse is better"? PHP is wildly successful because it caters to exactly the two people who interact with its niche: the harried sysadmin, and the new-to-programming "I want my webpage to have a counter!" crowd. Administrators like PHP because unlike other languages, it takes an almost monastic view to interpreter cleanliness: anything the user ever did is cleaned out at the end of a request. All functions, classes, and variables are destroyed. The parsed and compiled versions of the files it read in to fulfill the request are also thrown out. This gives PHP a handful of very important properties. One, its memory usage over time is limited to whatever is in the core language, because nothing else sticks around. Two, since it recompiles the world on every single request, the page shown always reflects the page as it currently exists on disk. Without caching, there can be no stale caches. And three, it allows for the speed gain (over CGI scripts) of embedding a language into the webserver without offering full control of that server. Users like the PHP model because not only is the language relatively easy to pick up, but mixing PHP and HTML markup in a single file is a wonderfully intuitive model. Everything they need to show "my home page" goes right in index.php without another thought, and they can just upload the thing with their FTP client, same as any other script. (And, unlike older versions of Perl, they don't even have to learn about CRLF vs. LF line-ending conventions to have the script run.) Java absorption seems to be strongest in the enterprise world and trendy CS departments at universities nationwide. It seems to me that the choice of Java is almost universally mandated from outside. Why is that? Is there something inherently appealing about Java to the enterprise? Is it actually good for something, or is it the mere baggage of managers locked into political choices based on the flood of Javahype in the late 1990s? If there's one obvious feature of Java, it's that it is a bondage-and-discipline language. A class named Foo must be defined in Foo.java, and woe unto the fools who think it could be otherwise. And if there's any other files... oh, never mind. There Can Be Only Classes. And while such a rule is painful and suffocating to programmers from more freewheeling languages like, oh, just about anything, there is one charm it holds for enterprise users: Foo is always defined in Foo.java. It may suck that idiomatic Java calls for excess use of design patterns, but on the other hand, if there's a Kingdom.getMasterBattleCoordinatorInstance() method, it has nowhere to go but Kingdom.java. The alternative to writing enterprisey code in Java is to write it in C++, and the result will be indistinguishable from XPCOM and Mozilla. It's the same stuff, but now nobody knows where nsIAbstractImplementorFactory lives unless they are handy with grep (and have sufficient patience).So then, that brings us back to Ruby and Rails. Are they occupying a niche? Is the enterprise a worthwhile goal, and if so, can it be reached? Ruby is, first and foremost, a language for hackers. OOP that doesn't hurt, perhaps. If a class doesn't do what it needs, extension or delegation are not the only choices, because extra methods can be spliced in just as easily as functions can be defined in ordinary languages. Of course, this is like a proverbial gun; it's easy to both use and abuse, and it takes a bit of practice and discipline to know the differences and use them wisely. Yet this is precisely the thing that the best programmers want at their disposal: a complete toolkit. Each padded wall added to a language to prevent average users from hurting themselves is one step closer to a mental institution for the great programmers. Rails carries the beauty of Ruby over to MVC web programming. There's a ton of magic in there, but it's a beautiful thing to be able to write validates_presence_of :name instead of if(strlen($name) == 0) required_field_error('Name');. It's a rush of pure freedom to be able to test the web code without having to get carpal tunnel while clicking links with the mouse all day.Yet it seems the lesson of Java is that beauty and freedom don't matter. As long as the language leads to a lot of work-like activity and doesn't offer too many dangerous choices, then the enterprise market is happy to accept it. Freedom is in fact their enemy, and because of this, the two communities can't standardize on a common language. I don't think trying to take Ruby to the enterprise would bring it to "the next level", where even more opportunities abound. It would necessarily crush some of the opportunities it has right now, and some of the development landscape it currently occupies. Ruby can't look good in both its current circles and the enterprise world, any more than the average person would look good in combat boots, aviator goggles, and a flowery dress. Respecting that one occupies a niche is not a failure. Failing to recognize the tradeoff in leaving one to claim another, is. Comments
Display comments as
(Linear | Threaded)
Add Comment
Originally based on the 'Coffee Cup' theme by David Cummins, then heavily modified right here at sapphirepaw.org. |