Ruby: Rosy Enough 1

Posted by dburkes Thursday, September 28, 2006 06:36:00

Someone pointed me to this article, written some months ago by Erik Bruchez. There aren't any comments on the post, and googling for it turns up very limited citations, so, apparently, Mr. Bruchez isn't well read. Which is good, because he's missed the point entirely about building international-capable web applications with Rails.

To be fair, the article is about Ruby, not Rails, but, these days, when you talk about Web 2.0, as he does in the article, you can hardly separate the two. So, while Mr. Bruchez is almost entirely technically correct in his criticisms of Ruby's lack of Unicode support, the criticisms that he makes have very little bearing on most Web applications built around Rails.

The point he makes is that, since Ruby natively regards strings as simply streams of bytes, you can't do things like split a string into words using the native String methods. This is completely true. He also makes the point that Ruby doesn't natively support i18n/l10n. This is also completely true.

The problem is, both of these points are completely moot for most web applications.

Rails is specifically designed for web applications that use a relational database for storage. Now, most relational databases have supported Unicode for some time now. And the fact is, for operations like searching and collation, database-driven web applications typically use the database for these operations- they don't do them in-core using whatever language they are written in. So, the fact that I couldn't (easily) search for "日本語" in a Ruby String object is really not a problem- the fact is, I would definitely use the database to do that for me. The same goes for collation- I wouldn't load hundreds of database objects into memory, then try to sort them using Ruby- instead, I would craft an appropriate ORDER BY statement. And I can tell you from experience that MySQL does a fine job of searching and collation in Unicode.

Over at Lingr, we've built a web application that supports any character supported by Unicode. You'll see lots of international text in our tag clouds, and in our chatrooms. you can use our search function to find rooms about "日本語" quite nicely, thank you. All this built on a language that has no native Unicode support- imagine that!

So, while Mr. Bruchez's criticisms may be accurate, they are not necessarily relevant.

Comments

Leave a response

  1. Jim GreerSeptember 30, 2006 @ 03:19 PM
    Good points, but I wouldn't go so far to say that the lack of native i18n support is "completely moot", for my application at least. It's a hassle - though one that's more than made up for by all the things that Ruby and Rails do well.
Comment