Wednesday, April 05, 2006

One thing why i love Ruby

Ruby is a great programming language. It makes programming very easy. (less write do more). Here is an Example:

Suppose we have to write code to swap the values in two variable, then the code will be some thing like

temp = a;
a = b;
b = temp;

but in ruby we can do it as:

a, b = b, a

this is known as parallel assignment in Ruby.