Ruby is a dynamic, reflective, object-oriented, general-purpose programming language.
It was designed and developed in the mid-1990s by Yukihiro “Matz” Matsumoto in Japan. According to its creator, Ruby was influenced by Perl, Smalltalk, Eiffel, Ada, and Lisp.
It supports multiple programming paradigms, including functional, object-oriented, and imperative. It also has a dynamic type system and automatic memory management.
Why Ruby and Rails?
Ruby on Rails is a super-productive environment for developing applications. It’s faster to build apps in Rails than in Java or .Net, hands down.
- Ruby is a powerful, easy to learn, fully object oriented language. Rails is nothing without Ruby.
- JRuby. Java is not going to fade away. It is and will continue to be an integral part of the enterprise. JRuby allows Rails to fit into that environment and leverage the hell out of it.
- Ruby’s community is growing by leaps and bounds every day… and so are its gems (libraries), plugins, etc.
- Built in tempting engine to generate web pages, emails, xml and text documents.
- Pragmatic philosophy of convention over configuration.
- Migration for applying or roll back database changes.
Object Oriented Programming Language.
Ruby is true object oriented programming language. Everything in ruby is an object. Every bit of information and code can be given their own properties and actions.
Here ‘Hello Ruby’ is string. Here length is the properties of of ‘Hello Ruby’ string and
reverse is the action of ‘Hello Ruby’ string. So here ‘Hello Ruby’ is an object which have both properties and actions. In ruby even string and integers are object.
Ruby is Dynamic type language
Dynamic programming language, in computer science, is a class of high-level programming languages which, at runtime, execute many common programming behaviors that static programming languages perform during compilation.
Here is simple example:
2 + 3 = 5 "2" + "3" = "23"
Here when I add two integer 2 and 3 it gives addition of 2 and 3 which is 5 and when I add two string “2” and “3”, it concatenate two string which results “23”.