# Perl vs Python vs Ruby

5/20/2004 1:52:34 PM

## Perl vs Python vs Ruby

I have a number of scripts written in Perl for code-generation and other build tasks. Over time, however, I have been put off by my inability to read quickly Perl code that I have written six months before.

Perl is the most popular and also the fastest scripting language, but the syntax is horrendous. It is concise for simple procedural scripts, but it gets in the way for object-orientation and large scale programming tasks.

I am currently evaluating both Ruby and Python as replacements, and it is not clear to me which is better for my needs. In either case, both seem to provide more maintainability and readability than Perl. They provide explicit and clean support for class, modules, function parameters, exception handling and iterators. Also, variables only contain references not values, which greatly simplifies these two languages compared to Perl. In Perl, there was a different construction operator for an array (), an array reference [], a hash reference {}. In addition, Perl had a C-like dereference operators var, @$var,$var->{}, \$var->[]; conversion from a value or reference to its reference required a preceding backslash just like C's ampersand. Working with advanced data structures became painful.

I have looked through a number of posts such as this one.

Python has been around for ten years and appears to be used in broader range of applications than Perl. I recently noticed a book on Game Programming with Python at Barnes and Nobles.

Ruby seems to be the most object-oriented and most expressive language, but, being new, it has less documentation, less third-party support and fewer available libraries. Ruby actually borrows more from Perl than Python does, so adopting Ruby may provide for an easier transition.

I'll most likely chose Python.