Python (Django) vs Ruby on Rails – By Nagesh

Ruby is an interpreted scripting language for quick and easy object-oriented programming. It has many features to process text files and to do system management tasks (as in Perl). It is simple, straight-forward, extensible, and portable. It also has freedom to use, copy, modify, and distribute it.

Main Features of Ruby

Ruby is an open source and object oriented server side scripting language like java and PHP.

By using Ruby, developing the web applications is better than compare to other languages.

The main feature of the ruby is less code, dynamic typing when compare to other languages.

Ruby has exception handling features, to make it easy to handle errors.

Ruby is a complete, full, pure object oriented language

Ruby can load extension libraries dynamically if an OS allows.

Ruby is an OS independent threading.

Ruby is highly portable: it is developed mostly on Linux, but works on many types of UNIX, DOS, Windows 95/98/Me/NT/2000/XP, MacOS, BeOS, OS/2, etc.

Similarities and Differences of Ruby & Python

1. Ruby blocks

Syntactically Ruby is better in this respect; Python’s functions are not as convenient as Ruby’s blocks, though they are mostly equivalent in functionality.

2. Syntax

One of the main advantages of Ruby is the simplicity and readability of its syntax. Ruby code is far less cryptic than python.

3. Regular expressions:

Python has support for regular expression through a library object

Ruby has extensive regular expression support.

4. Object Oriented:

There has been much debate if Python is truly a pure object oriented language. Python is a pure object oriented language as every variable is a reference to an object. Python allows both procedural and object oriented designs. It is possible to write functions in addition to methods. The programmer is required to use functions because there is much built-in functionality in python.

Ruby is pure object oriented language. In Ruby everything is an object. There are no built-in types like ‘int’ in java. The part which is different from Python is the fact that all operations are messages to objects. That is there are no functions, only methods.

5. Access Protection:

Python initially had no access protection; a mechanism has been added called name mangling which renames class members starting with \ “(two underscores) to\ “. Thus references to members outside the class cannot get the same mangled names.

Ruby supports private, protected and public types of access to the elements of a class. By default all methods are public except the initialize method and all instance variables are private.

Thus we believe that the above areas depicts why Ruby is considered a far more better option than Python to build a site.

Leave a Reply