Python vs Ruby


 

Python vs Ruby

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

Ruby is a dynamic, open source, object-oriented and reflective programming language. Ruby is considered similar to Perl and Smalltalk programming languages.


Python is a simple, easy to learn, powerful, high level and object-oriented programming language. It is an interpreted scripting language also.

Similarities:

1.    They both are high-level language.

2.    They both are a server-side scripting language.

3.    Both are used for web applications.

4.    Both work on multiple platforms.

5.    Both have clean syntax and are easily readable.

6.    Both use an interactive prompt called IRB.

7.    Objects are strongly and dynamically typed.

8.    Both use embedded doc tools.

9.    GNU Debugger(gdb) style is available for each language.

10. Both languages are supported by Emacs modes.

Differences:

 

TERMSPYTHONRUBY
DefinitionPython is a high level programming language.Ruby is a general purpose programming language.
Object OrientedNot fully object oriented programming language.Fully object oriented programming language.
Developing EnvironmentMany IDEs are supported.Eclipse IDE is supported.
MixinsMixins can’t be used.Mixins are used.
Web frameworksDjangoRuby on Rails
LibrariesHas larger range of libraries.It has smaller library than Python.
elseifelifelseif






Anonymous functionsSupport only lambdas.Support blocks, procs and lambdas.
lambda functionsIt support only single line lambda function.Its lambda functions are larger.
FunctionsIt has functions.It Doesn’t have functions.
CommunityFocussed in academia and Linux.Mainly focused on web.
switch/case statementIt doesn’t support switch/case statement.It support switch/case statement.
yield keywordIt returns execution to the scope outside the function’s invocation. External code is responsible for resuming the function.It will execute another function that has been passed as the final argument, then immediately resume.
Built-in classesBuilt-in classes can’t be modifiedBuilt-in classes can be modified
InheritanceSupport multiple inheritance.Support single inheritance.
TuplesIt support tuples.It doesn’t support tuples.
UsageGoogle, Dropbox, Instagram, Mozilla, Yahoo, Venom, You TubesApple, GitHub, Twitter, Hulu, ZenDesk, Urban Dictionary

0 Comments