CSC/ECE 517 Fall 2009/wiki1a 11 rubyvspython
Ruby vs. Python
Introduction
Python and Ruby are amongst some of the most popular programming languages in use today. When compared with the array of other languages these two seem almost similar but on closer observation we can find that they can be contrasted in various ways. There seems to be a continuous debate on trying to prove one over the other between their users.
Definitions
Python
Python is an object oriented programming language which supports scripting and was developed with the purpose of providing developers with a language which was both easy to code and read.
Ruby
Ruby is also an object oriented programming language with strong scripting support. It was introduced after python and hence primarily developed to incorporate perl-like scripting abilities with better object oriented functionality than Python.
Feature Comparison
Before we compare the two languages, maybe its a good idea to relate them! There are a lot of features that Ruby and Python have in common. Some of them are:
- HighLevel ??
- Garbage Collected ??
- fully dynamic type system ??
- automatic memory management ??
Now, let us see how these two languages differ in their features:
For a brief summary of differences, see table below.
Strings in Python vs. Strings in Ruby
String objects in Python are immutable whereas in Ruby strings are mutable objects.
An immutable object is an object whose state cannot be modified after it is created. This is in contrast to a mutable object, which can be modified after it is created.<ref>Immutable object</ref>