There are many differences and similarities between Ruby and Python programming language.


Similarities

  • They both are high level language.
  • They both are server side scripting language.
  • Both are used for web applications.
  • Both work on multiple platforms.
  • Both have clean syntax and are easily readable.
  • Both use an interactive prompt called irb.
  • Objects are strongly and dynamically typed.
  • Both use embedded doc tools.

Differences

Terms

Ruby

Python

Definition

Ruby is an open source web application programming language.

Python is a high level programming language.

Object Oriented

Fully object oriented programming language.

Not fully object oriented programming language.

Developer

Yukihiro Matsumoto in 1990s.

Guido Van Rossum in 1980s.

Developing Environment

EclipseIDE is supported.

multiple IDEs are supported.

Libraries

It has smaller library than Python.

Has larger range of libraries.

Mixins

Mixins are used.

Mixins can't be used.

Web frameworks

Ruby on Rails

Django

Community

Mainly focused on web.

Focussed in academia and Linux.

Usage

Apple Github Twitter Groupon Shopify ThemeForest

Google Instagram Mozilla Firefox The Washington post Yahoo Shopzilla

Built-in classes

Built-in classes can be modified

Built-in classes can't be modified

elseif

elsif

elif

Unset a variable

Once a variable is set you can't unset it back . It will be present in the symbol table as long as it is in scope.

del statement help you to delete a set variable.

yield keyword

It will execute another function that has been passed as the final argument, then immediately resume.

It returns execution to the scope outside the function's invocation. External code is responsible for resuming the function.

Anonymous functions

Support blocks, procs and lambdas.

Support only lambdas.

Functions

Doesn't have functions.

It has functions.

Tuples

It doesn't support tuples.

It support tuples.

switch/case statement

It support switch/case statement.

It doesn't support switch/case statement.

lambda function

Its lambda functions are larger.

It support only single line lambda function.

Inheritance

Support single inheritance.

Support multiple inheritance.