Ruby is just not what I'm looking for.
Recently I started the development of a website. It's small website that's, from the outset, just a job search website. However, behind the scene, what it does it to aggregate the job information from several (15 at this point) websites together and present to the user in one place. Internally, it's a fairly complex system because it has a lot of concerns mixed into it such as character encoding, networking, multithreading, synchronization, extensibility.
I started it off with Ruby on Rails because I bought a book about it and read it through out, but never got a chance to write anything significant with it. I tried using it and start appreciating Ruby language itself. It has many nice features and whatnots. However, when it came to connecting to other job website and extract the data, Ruby on Rails is just a big mistake that I made in choosing it for this website.
From my perspective, the problem with it is that the character encoding libraries are just so poor. So poor that I have to almost do everything myself to make sure that the data received are all consistent, instead of using the library. For those familiar with Java, you know right away how a good library should look. It's not even close in Ruby. Basically, I have to be so aware of all the idiosyncrasies with encoding and decoding, instead of being able to focus on the problem at hands.
That's not the worst part of it though. The worst part comes from the language itself. You might have heard that Ruby's classes are open. One can always modify the behavior the existing classes, including the system ones. This sounds good but in practice this is a very stupid idea. I have to say this because this simply bring us back to the era where everypart of the system can modify everything.
How did that contribute the problem I had? Part of data extraction I did is to use lots regular expressions to recognize pieces of the data the system cares about. As it turns out, the regular expression works one way when running in Rails environment and another when running in non Rails. That means I could not just run a short script outside Rails to do prototypes. Then I faced things like: it works when running alone then stop working when running in Rails. And the vice versa.
For God sake, I have to exclaim this because it wasted a lot of time playing around with it. At this point, without any bias, I can tell you that Ruby is a good scripting language for small stuff that you just write it and run it once in a while. However, I can guarantee you that it will NEVER EVER be the language of choice for medium to larget system, so long as the feature that allows people to change the existing class behaviors still exist.
For those who really like the language, I would like you to try it with data extraction that has many different encoding in different languages and use regular expression in it. And you'll see what I mean and it might change your perspective.

0 Comments:
Post a Comment
<< Home