Ruby: Result of a Japanese guy that just wanted to be happy programming and made a revolution

Ruby – is a reflective Object Oriented (OO) dynamic language created by Yukihiro Matsumoto (Matz) in Japan with the objective to rescue the fun and happiness in programming, designed with principles (see below) to free programmer’s mind from the hindrances of that is usually should belong to the compiler, leading him to behave more intuitively, remaining thus the most important tool – the intelligence, and so creativity, happiness, motivation and productivity.

Since 1995, its popularity in Japan has grown at an astounding rate and now it is conquering the western world as it is being the most recent language well succeed to address the complexity and productivity.

Ruby being true OOP where even the literals and known primary types are really objects. But it has not stopped here, it rectifies the class concept not attaching it necessarily to a type but to the behaviour, this is known as “Duck Typing” and also bring a lot of new more appropriated structures to OO such as blocks, closures, iterators and dependency injections, thus creating a multi-paradigma approach. And at the same time is simple and easy to learn, try for example to play with “irb” the interative Ruby shell (http://tryruby.hobix.com), you can start doing simple things going to the most complex ones interacting as any other OS shell but interpreting Ruby at the same time. Another thing interesting is that, as everything is an object, the variables are not and are not attached to any type as well but are to the scope. So as they can hold any object, therefore at the end they are the thing that defines their scope!!

One of the great secrets of Ruby and somewhat difficult to the newcomers understand – is the great difference about the Ruby way of programming. Ruby is a fresh air, and really provide a new experience about programming. One of them is that Ruby do not need necessarily a statement to return a value, cause it always return the last handled object or collection. This feature unified with that the compiler allows nested specifications become very handy and powerful. This is just one of many things that the Ruby compiler shows its intelligence, removing trivial and repetitive tasks and allowing the same time multiple ways to specify statements.

The framework designed for web “Ruby on Rails” was the catalyst for Ruby and it has exploded, became world-wide known, climbed up to the 13th place in the Tiobe index (http://www.tiobe.com/tpci.htm), and the impact has been so huge that lead everybody to reflect again about if the static nature and the direction of the current software languages known nowadays was right, and also that the programmer was set apart from this movement. Ruby rescue this relationship in every detail of its design and direction, as software is not a manufactured thing, but done by human beings!!

Quotes:
“I think the dynamic languages are posing the greatest threat that Java has yet to face.”
“Ruby makes me happy because it allows me to write beautiful code. Aesthetics are strongly linked to enjoyment. It’s not just about “getting the job done”. It’s also about being satisfied with the way the job is getting done – being motivated to improve the way the job is getting done, and to take pride in its execution. I simply can’t do that with ugly code. Ruby allows me to escape the ugliness. Thus, Ruby allows me to be happy about programming. Happiness leads to motivation. Motivation leads to productivity.”

by David Heinemeier Hansson the Danish creator of Ruby on Rails.

“Programming should be fun. Humans should take care of human business and machines should take care of their side.”
“Programmers often feel joy when they can concentrate on the creative side of programming, so Ruby is designed to make programmers happy.”

by Yukihiro Matsumoto.

“Ruby’s advantage though is not in it’s blazing execution speed but it’s blazing coding speed.”
by Zed Shaw.

“After Ruby – software development will never be the same where for the first time in history the human condition is taken in its developing process, resulting a coherent movement which is pure intelligence.”
by Roberto Nogueira leader of Ruby Programming community in KSTool.

“Ruby supports Natural Intelligence – yours”
by David Thomas and Andrew Hunt from their back-cover book – Programming Ruby.

Further Information:
Wikipedia
http://en.wikipedia.org/wiki/Ruby_programming_language

References:
Ruby Homepage
http://ruby-lang.org
Ruby Homepage (redesigned)
http://new.ruby-lang.org/en

Ruby Principles:
Ruby applies these combined principles beautifully.

DRY – means “Don’t Repeat Yourself”: If you look at Java or C++ code you will see semicolons everywhere, signifying line endings. Ruby says, “I already know it’s the end of the line because you just press Enter to start a new line”. result: you save keystrokes. With Rails, there are some conventions agreed between you and your computer. For example, if you have an inventory system with a main database called myitems, then RoR will create a model called MyItem (notice the caps). You can access the result sets at myitems or the row using myitem (the singular form). Once you agree to this, then you should never have to write another line of cryptic database language. The bad thing about code generation hype is that it tells you that it will generate a full application for you and you don’t have to do a thing. But then it spits out a lousy application with gigantic overhead that can barely satisfy your needs and you can do nothing about it. Rails, on the other hand, doesn’t try to generate code for you, it just sets up a scaffold for you to customise. It does the job halfway but it certainly does it very well.

POLS – is the “Principle Of Least Surprise”. Surprise could be good for marketing but definitely bad for business. One wants to run a business as smoothly as possible with constant growth, controlled risks and zero defects. If you invest a million baht into a 10% ROI project, you shoudl receive 1.1 million back. Programming is the same thing: you write this and get that result, but in another circumstance you write the same thing but get something else. And that’s a bad surprise. It helps that Ruby tries to hide away the computer tasks so there are fewer things that could get in the way between you and your business process.

TMTOWDI – Programmers come from many backgrounds and they do things differently, which can be annoying. Ruby uses “There is More Than One Way of Doing It” or TMTOWDI (pronounced Tim Toady). You can call a function with parenthesis or without. You can use {} or type ‘end’. You can use ‘call’ or ‘yield’ a method. Did I mention the plural and singular and all the Rails agreement? Well, you could tear up the agreement and override all that.

Advertisements
Explore posts in the same categories: Articles

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s


%d bloggers like this: