Ruby vs Python

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

TermsRubyPython
DefinitionRuby is an open source web application programming language.Python is a high level programming language.
Object OrientedFully object oriented programming language.Not fully object oriented programming language.
DeveloperYukihiro Matsumoto in 1990s.Guido Van Rossum in 1980s.
Developing EnvironmentEclipseIDE is supported.multiple IDEs are supported.
LibrariesIt has smaller library than Python.Has larger range of libraries.
MixinsMixins are used.Mixins can't be used.
Web frameworksRuby on RailsDjango
CommunityMainly focused on web.Focussed in academia and Linux.
UsageApple Github Twitter Groupon Shopify ThemeForestGoogle Instagram Mozilla Firefox The Washington post Yahoo Shopzilla
Built-in classesBuilt-in classes can be modifiedBuilt-in classes can't be modified
elseifelsifelif
Unset a variableOnce 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 keywordIt 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 functionsSupport blocks, procs and lambdas.Support only lambdas.
FunctionsDoesn't have functions.It has functions.
TuplesIt doesn't support tuples.It support tuples.
switch/case statementIt support switch/case statement.It doesn't support switch/case statement.
lambda functionIts lambda functions are larger.It support only single line lambda function.
InheritanceSupport single inheritance.Support multiple inheritance.