Ruby, The OOP language of the future

Ruby is AWESOME.

Yes thats right awesome. Ruby is a language that is both simple and powerful. It is completely object orientated, where everything that you work with is an object. That is numbers, strings, data structures and any program construct that you can think.

Created in japan by Yukihiro “matz” Matsumoto and released in 1995, It has since grown into a widely used langauge, in the top 10 listed languages on github project language page. This is mostly due to the natural order of programming, having a limited amount of clutter.

Ruby is also an interpreted language. We will go into this more later, but essentially means that it runs inside a special program that is built to take the ruby code and execute it. It is not necessarily the fastest interpreted languages, but it is one of the most powerful. There is a number of different interpreters, invoking different mechanisms and built in different languages (the major ones are c and java). This allows the user to implement different interpreters depending on the execution environment.

Lets look at some code, how about a hello world program. But first we need to install ruby on our machine. For ubuntu and fedora the code for installation is as follows.

sudo apt-get install ruby1.8 rubygems1.8

yum install ruby.i386 ri.i386 ruby-mode.i386

Now create a file named helloworld.rb and put the following line on the first line.

puts "Hello World!"

Yep thats it. Run it in the command line by using ruby helloworld.rb and it will output will be the string Hello World! This ease of use is due to mostly to the number of executed lines of per line of ruby code, averaging around 15 per ruby line.

Before continuing on with more examples, finishing of this post on ruby will be about ruby on rails, the new web programming application which comes inbuilt with its own web server and many other features.

Rails as its collectively known, was released to the public in 2003 by David Heinemeier Hansson, although now is actively developed by a team of 1600 community developers lead by a core team. The core concept behind rails is that it allows you to right the beautiful code of your ruby apps, in a web environment.

Thats about all for a first introduction of ruby, next time i will show you how to set up a working environment for deploying ruby on your machine (Linux first and then windows and mac). Why not read up on the ruby programming language.

Leave a comment

1 Comment

  1. This was a nice article to read, thank you for sharing it.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: