Introduction
If you are a part of the programming world, you must have heard about them. Today we’re going to talk about the difference between ruby and ruby on rails and the unique purpose they serve in the domain of Web development.
Ruby
Ruby is an object-oriented programming language that dates way back to 1995. It was developed by Yukihiro Matsumoto. Although it is written in the C programming language, Ruby also contains certain characteristic features of other languages like Perl and Python. Ruby comes loaded with useful features and is extensively used for Web app development. With a simple and neat syntax (just like C and Perl), Ruby is easier to both understand and write, and is hence, a great language choice for beginners.
Despite fashioning a simple and elegant syntax, Ruby was not really a hit with programmers in the past. The real moment of fame for Ruby came with the development of the Rails framework that was built on the core aspects of Ruby. It allows for the smooth and convenient integration of high-level abstractions (for instance, metaprogramming) which further helps in developing a domain specific language.
Ruby on Rails
Ruby on Rails (RoR), better known as Rails, is a web application framework that was developed by David Heinemeier Hansson. While he started developing the Rails framework in 2003, it was made public only in 2004. Written in the Ruby programming language, the Rails framework is based on the MVC (model view controller) architecture. The specialty of the MVC architecture is that it allows data to be delineated from a UI to offer varying possible views of the data. Apart from this, the Rails framework also supports RESTful API. Essentially, Rails was developed to function as a support framework for web application development by facilitating seamless integration of Ruby with JavaScript, HTML, and CSS.
The Rails framework strictly abides by two fundamental concepts. The first one is the DRY (don’t repeat yourself) and the second one is the COC (convention over configuration). Don’t Repeat Yourself, as the name suggests, stresses on the fact that one should never have to repeat the same lines in a code again and again. COC ensures that a code is concise and readable as in it should not contain big configuration files. Instead, it allows you to use a set of default configuration files. Both these principles make sure that a code written on the Rails framework is clean, well-designed, and scalable.