From the views of a layman, Ruby is a beautiful, precious stone with an ever attracting red color. But for a programmer, ruby is as precious and gorgeous as the gem but in the form of a programming language. The developer’s of this language claim ruby as a “programmer’s best friend”. It was created in 1993 by Yukihiro Matsumoto of Japan.
Take a look at these words of the creator:
“Language designers want to design the perfect language.They want to be able to say, ‘my language is perfect. It can do everything.’ But its just plain impossible to design a perfect language, because there are two ways to look at a language. One way is by looking at what can be done with that language. The other by looking at how we feel using that language- how we feel while programming”
– Yukihiro Matsumoto, creator of Ruby
Ruby is an upcoming programming language spreading its roots far and wide. The main beauty of a language is its simplicity. Ruby is** simple** in appearance but has a complex internal structure making it beautiful in its own way.
As most of the programming languages, Ruby is completely free and open source, but subjected to a license making it easily available in any platform. Moreover, Ruby has great similarity in appearance to popular programming languages like Python and Perl but it has similarity in syntax to C++.It has a very neat, clean and easily understandable syntax which can be captured easily even by a new developer.Ruby has its application confined to web development which consists of developing Internet as well as Intranet applications. Ruby has its own web application framework named*** Ruby on Rails***which is gaining high popularity in recent days .Many of the must-need applications for a coder like *Github* , *Basecamp* was built by ruby on rails. It has a MVC (Model View Controller) framework and it also encourages use of existing languages like HTML, XML, CSS, JS..etc for building the desired application.
It is purely an** Object Oriented** Programming Language but with a little twist from the existing ones. All the OOP concepts like abstraction, polymorphism, inheritance and encapsulation are possible with ruby. But here, each and every part of the code is an object. Ruby offers excellent flexibility, portability and exception handling features.
What makes Ruby stand out from other languages??
Apart from all the above highlighted features, Ruby has so many extra, exceptional features that many other programming languages cannot do like changing background colour, easy build of small game applications , adding images to labels, buttons and so on. It has an inbuilt* tk* library that makes these features come into practice.
Lets look at an example. Given below is the code to create a button application and the output generated when the code is run in a suitable compiler. The code uses tk library.
Example of a code to add image on a label:
Subscribe to Code Rewritten
Get the latest posts delivered right to your inbox