Jeff Schwab
7/8/2006 3:36:00 PM
howachen@gmail.com wrote:
> Besides ROR, can you give me a reason why perfer ruby instead of
> python?
>
> seems to many users, they are very similar in nature...
>
> such as
>
> 1. non C or Java style syntax
You're going to have to find a language that wasn't influenced by Algol.
Good luck.
> 2. focus on codes readability, not like Perl
Perl makes it easy to write clear, readable code. Perl also makes it
easy to write incredibly dense, ugly code. Blaming the language for
crappy code is like blaming a bicycle for not having training wheels
welded to the frame.
> 3. ..
Want my dumb reason for preferring Ruby to Python? I tried to go with
Python, but it kept annoying me that I had to type a bunch of redundant
parentheses. From Perl, TCL, and Unix shells, I was used to being able
to pass arguments to methods without parentheses. Extrapolation: The
vast majority of scripts I write are short, but Python seems to be
geared toward large-scale development. Ruby has good support for both
scales of design, so why not go with Ruby?
The one thing that sticks in my craw about Ruby is that File::Separator
is a forward-slash ('/') on Windows. This is just wrong, and it means I
have to replace the slashes with back-slashes manually before passing
file paths to command-line programs. If you pass a Windows program a
path like /some/path, the program will try to interpret path elements as
switches. It's almost the equivalent of having File::Separator be a
hyphen ('-') on Unix.
If the above reasoning sounds petty, keep in mind that these relatively
minor language and library features are effectively the face of the
language. Beauty is only skin deep, but warts are annoying.