Sunday, October 02, 2005

Al2O3

Today's post is about chemistry...

-----------------------------

Just kidding. We are gonna talk about the Ruby programming language today. Due to some further developments, I am currently learning about this language.

After gaining some experience with various other languages, I decided that this was one of the languages that I probably should study next. It is true that I am not quite proficient in about three of my latest additions to programming languages (Perl, Lisp and Java) but I do understand them well enough for most of the purposes, and I can learn more about them if the need arises. The fact that I was getting a little bored solving various logical challenges might have had also something to do with it.

As a result, learning Ruby seemed like an interesting proposal. I have seen a lot of people going over there had about this language so I gave it a try.

This article will not describe Ruby yet (wait a little, I will get to that next time). This article will tell you some of my thoughts that appeared while I was learning RUby

I like Japanese people. And it is not only because of the fact that I practice martial arts. I like the fact that they have self-discipline and a desire to work and they love simple things.

In a way, they are probably the one country from which Romania can learn the most. It was amazing how they got over the defeat in the second world war. It was also amazing on how they take their time doing everything they do.

In a way, it is not very amazing that a language like Ruby comes from a Japanese. It seems to me that their basic idea is that of simplicity and perfection. This is different from perfection in the European way, which is more something like Rococo. It is also different from the American way which is something like maximum efficiency through minimum effort. The Japanese (or Asian?) style is more something like "Let us do this perfect with minimum resources." The results are often surprising.

In programming, we have got some programs which we know and love for various reasons. However, as our experience with them grows, we also become painfully aware of their limitations. Of course, to a guy who doesn't know the language there are some obvious limitations to the language, but these limitations are most of the time features. However, once he understands the language he sees the true limitations. And these limitations are generally very intimately related to the limitations seen by the beginner...

Let's take one example: Perl. Perl is a great language, great user community, etc. What is the one most obvious flaw in Perl? Those goddamn signs before variables. Well, this is also the first thing you don't really mind once you get to know a little Perl. However, when you really know Perl, the thing that bothers you most is the syntax, which makes it difficult to memorize easily the code, to search through it quickly, to find examples with Google, to do x,y and z other things. The code written in Perl looks ugly.

How strange is that?

Here is another example: Python. What puts you off first when you learn Python? The annoying fixed space syntax used for block delimitations. You eventually go over this realizing that you're code is much more readable this way. Everything is crystal clear in Python. No ugly source. There's only one thing to do everything. What annoys you most when you get to know Python somewhat? Well... probably the execution speed. Python is not really that fast when compared to other languages. Why, couldn't we do it faster? Of course we could, but then it would also mean optimizations at the interpreter, and stuff like that. And this would make the code not that much crystal clear anymore. No more ice palace.

I could go on about other languages as well.

What about Ruby? Well Ruby seems like it learned something from those other languages. While definetly no match for Python or Perl or any of the other languages that I know (except probably Lisp) it is most certainly a clean language. It doesn't have a lot of problems because of its simple way of doing things. Here, simple is different than in Python. While in Python simplicity is somehow mathematical (and sometimes even forced) in Ruby it is gently suggested. As a result, if sometimes the more complexity is required for achieving a better result, the code might get more complex.

Unfortunately the user base is scarce (to be read as inexistent). In time, this is probably going to change. It is known that Japanese are very patient when doing something.

That's enough for today. When I'll get back to Ruby, I'll discuss more on the technical aspects related to it, and I'll point out the differences between it and other languages.