Fatal Shocks

February 12, 2007

Ruby

Filed under: Uncategorized — Hasan Maqbool @ 10:43 am

It has been really great to have a scripting language like Ruby. It is really great to work in Ruby. Ruby is so dynamic. It has got the potential to break the high walls of conventional programming styles. You don’t need to declare variables in the conventional Programming Language styles. Syntax is quite elegant.

For example, if somone wants to put something on the console

Say I want to put my name in there, what I need to do is

>>puts “Hasan Maqbool”

and it will work.

Similarly, strings are so much powerful like you can say,

>>”Hasan Maqbool”.length

Output on the console will be 13.

This statement returns the length of the string which invoked the method. There are many more string methods like reverse.

>>”Hasan”.reverse

it reverses the strings like nasaH etc.

Create a free website or blog at WordPress.com.