Monday, November 30, 2009

Why Perl Lost It

Over the last several years it has become fairly obvious that Perl has lost the prominence and popularity it enjoyed in the late 90s and early 2000s, which can be seen from many different angles:
  • Google Trends [1] and the TIOBE index [2] show a steady decline over time [1]
  • A wide reaching survey at Langpop places Perl near the bottom [3]
  • A lot of Perl talk centers around people vigorously stating that Perl is not dead [4] and other kinds of cries for attention [5]
There are many reasons behind this decline, but put quite simply, Perl was outclassed by the competition and lost mindshare amongst developers.

On the low end, PHP became the defacto web development language thanks to its ease of development and deployment. While many developers decry PHP's ugliness and its simplistic nature (no closures, no namespaces, 3000 functions), it nevertheless made web development far more accessible to everyone and thus allowed a huge number of people to make the products they wanted, and helped some notable companies (Flickr, Facebook etc).

On the other end, Python's steady improvement over the years (which made it both more powerful and easier than Perl) attracted a lot of companies and developers, while Ruby and Rails attracted developers who wanted more flexibility out of their language. While this was happening, there were no significant releases to Perl5 and Perl6 was nowhere in sight.

Another significant factor I believe was Perl's much beloved "There's More Than One Way To Do It" principle. While marketed to developers and giving them freedom and flexibility, it also hamper's Perls practicality.

First, it makes the language extraordinarily complicated. While most good designs struggle and strive for simplicity and coherence (the K.I.S.S. principle), Perl goes for the kitchen-sink mentality. Its table of operators can only be described by "gargantuan" and is only eclipsed by its grammar, which is at least 5 times larger than the grammars of languages like Python and Haskell. What this means is that Perl demands far more time out of a developer to become proficient at it, while offering no significant benefits for someone investing this extra time.

Second, it makes it hard for the community as a whole to progress. For example, while Python added new-style classes and pushed everyone into adopting them, there is no way for Moose to easily obtain the same ubiquity (as no one can push it and enforce it). In fact, it is rather telling that Perl's premiere web development framework, Catalyst, only acquired a decent object system in mid 2009.

Whether Perl will continue to decline or not is hard to say, though I highly doubt it'll ever return to its former glory - neither Perl5 nor Perl6 seem to offer much for developers who do not already love Perl.

Easter Egg: The Forex Chart Monkey gives advice on Picket Prevention and Forex Technical Analysis

Saturday, November 21, 2009

The Making of

Welcome to the first of a series of blog posts I'll be writing about the ongoing development of Although the project is several weeks old, it is still early in the development life of the game and I am hopeful that these posts will provide some insights to other developers about working with some interesting new technologies, as well as random tetris and network-programming related tid bits. is in essence a modern implementation of the classic Tetrinet game. For those who are not familiar with Tetrinet, it is a fun and well-made multiplayer version of Tetris. Up to six players can join a game, then divide themselves into teams. Once the game starts, every player gets to control a single tetris field. When they make a line in their field, a random block will turn into a special power/attack and if a line is destroyed that includes that special power/attack, the power gets transfered to the player's attack queue. As the game progresses and players make lines and accumulate powers, they can use those powers/attacks either on themselves or on other players. For example, if a player gets a Clear Line and Add Line powers, they use use Clear on themselves and Add on an opponent.

While the original Tetrinet was great, it is now an old game (it was first released in 1997), works only desktop OSs and makes it really hard to find players on demand. (so named so that it does not infringe on any trademarks) will be web-based version, available across modern web-enabled devices (iPhone, Android etc) as well as any modern web browser. In addition, will offer automatic on-demand player matching and focus on simplicity of game play. It is my hope that BlockBattle will turn out to be a novel, fun and engaging game for users, while offering an interesting exercise in game, UI and web development for the developers.

The major design outlines of are:
  • The front-end game play will be done in JavaScript. Piece movement, generation, etc will be done client-side, while major events (dropping a piece, attacking an opponent) will be sent to the server so all player fields are synced at all times.
  • Using HTTP Long-polling (AKA Comet) to enable the sever to push events to the client, such as the player getting attacked.
  • Rather than the Tetrinet way of finding players, whereby one person starts a server and other players connect to the IP, will try to automatically match players, so users can simply log in and start playing
  • Making the game accessible on mobile devices by embedding a WebBrowser within an application, then making local inputs (buttons, gestures, taps etc) control the game.
Some of the technologies we'll be using:
  • JavaScript/DHTML for the game front-end.
  • Tornado Webserver - Tornado is a real-time python webserver that powered FriendFeed's website. Tornado was chosen because it is a fast, lightweight framework well suited to the needs of a push server. As well, it is written in Python which is popular, easy to develop for and quite powerful.
  • Mobile Apps: Popular mobile devices such as the iPhone, BlackBerry and Google Android phones will have native apps for BlockBattle, each of which will offer as simple UI customized to the handset and the kind of controls that are suitable for it.
For some silliness, check out the Forex Chart Monkey that helps you with Pickpocket Prevention and Forex Technical Analysis.