Sunday 22 April 2012

What is Ruby language? Or about Ruby Or Ruby Features...

Ruby is a scripting language created by Yukihiro “matz” Matsumoto(Japanese) in 1993, inspired from Perl, Smalltalk, Eiffel, Ada, and Lisp. Almost all of the good things from above mentioned languages are present here to minimize the effort of coding and also to reduce frustration.


Some features of Ruby(about Ruby):


1. Its a pure object oriented language with almost 45 keywords -  what ever you will write/see in ruby code is an object except argument list(whenever you are passing parameters) and control flow syntax like if, rescue, begin, end, class, alias etc.
2. It does not support multiple inheritance, but gave us 'MIXIN' - to include modules in classes, then we can access any of the methods of the said module.
3. Its a portable, cross platform & interpreted language.
4.  Its flexible - as it is open source we can redefine it as our own interest. In terms of coding also its provides us a high level flexibility - we can extend a class even it could be a basic method/class(Ex we can redefine integer or string) which we can alter or can add our own lines of code through 'block' we can add closure to any methods we have defined previously(classes are open). 
5. We can write multiple lines of code in a single line with statement delimiters and gives us open ground to write our code as we wish in our own format (no need to start from a specific line/column like few other languages) but it case sensitive
6. Its gives a excellent way to error handling like java and has its own garbage collection which is maintained automatically- though we can do it manually too.
7. Another very important thing is Ruby provides a OS independent threading even if the OS does not support threading still Ruby can handle it.
8. Untyped or loosely typed - we don't need to declare any variable type but can store any value directly.
9. Access modifier continues until the end of the scope, or until another access modifier pops up, whichever comes first. By default, methods are public. In Ruby,public is, naturally, public. private means the method(s) are accessible only when they can be called without an explicit receiver. Only self is allowed to be the receiver of a private method call.
protected is the one to be on the lookout for. A protected method can be called from a class or descendant class instances, but also with another instance as its receiver.10. Its gave us singleton method and a special method for missing method named method_missing.
11. A method call is like a message passing than function calling.
12. And lastly IT IS FREE yes... it is free so no extra licensing cost is there. 


These are gist only. If you have any quarries or any doubt feel free to post. 


Please also post your quarries here... it is not mandatory to be related to above topics. :) :p ....

1 comment: