Comparing Ruby with Perl and Python
|
|
|
|
| Articles Reviews Ruby | |
| Written by Michael Neumann | |
| Wednesday, 21 February 2007 | |
|
Page 1 of 11
{mos_sb_discuss:50} I’ll compare Ruby with Perl and Python, because I think they are the most frequently used and best known ones. Ruby has so much advantages against Perl and Python, that I’ll try to mention here as much as possible. At first I’ll shortly explain what Ruby is: Ruby is a modern, interpreted and object-orientated programming language. It has many similarities with Smalltalk (”everything is an object”, simple inheritance, metaclass-model, code-blocks, garbage-collector, typeless variables, etc. . . ), but takes much of the well formed syntax of Eiffel (or who don’t know that great language, it’s a little bit like Modula or Ada). Additionally many useful elements from Perl were added (e. g.
regular expressions, text-processing, text-substitution, iterators,
variables like $ $/ . . . ). Therefore, Ruby is a very good alternative
to Perl and Python. The difference between Perl and Ruby is the much
easier and better to understand syntax and the easy-to-use ”real”
object-orientation. Following term which I have found on a Ruby-page expresses the power of Ruby: As you can see, Ruby was developed, having Perl, Python, Smalltalk and Eiffel (as well as some other languages) in mind. So matz took the best from the above called languages to make a new, better, object-orientated scripting-language. Unlike Perl and Python Ruby was designed totally object-orientated right from the beginning. So there’s no clumsy syntax for declaring a class like in Perl. That is why many people, myself included, say that Perl isn’t really object-oriented. I agree with Stroustrup, the developer of C++, who once said that a special programming-style (e. g. OOP) is only sufficient supported if the language makes it easy to use this one. And I do not think that Perl supports sufficient enough the use of the object-oriented paradigm. A big advantage of Ruby is, that it is very easy to learn, and so could perhaps become a language to introduce people into programming or object-orientation (maybe at school instead of the often used language Pascal).
|
|
| Last Updated ( Sunday, 08 July 2007 ) | |
| < Prev | Next > |
|---|







