Searching for the best scripting language,

Thorsten Kampe thorsten at
Wed Jun 16 14:08:17 CEST 2004

* Ryan Paul (2004-06-14 02:20 +0100)
> I recently learned ruby, merely out of curiosity. Now that I know it, I
> dont write ANY shell utilities with python anymore. Ruby is a much better
> choice for almost all simple administrative tasks. For larger programs,
> there are times when python seems like a better choice. Python enforces
> consistency and readability. In an environment where many people will be
> working on the same code for an extended period of time, the benefits of
> python become apparent. That isnt to say that ruby *cant* be used in
> situations like that. If ruby programmers layout strict guidelines for a
> project regarding style and methodology, it would be just as effective.
> The proof is in the source. This is part of a ruby program I wrote. This
> snippet is actually a single 'line'. I broke it into several lines for
> slightly improved readability. This single line would probably take at
> least 15 lines to do in python, probably more if you wanted to do it
> intelligently. 
> ["*.rar.*", "*.r[0-9][0-9].*"].each {|fn|Dir[$prefix+fn].collect {|x|x.gsub(/\.\d+[\d.-]*$/,"")}.uniq.each {|x|`cat #{sesc x}.* > #{sesc x}`} }

If you still believe in oneliners you deserve Ruby (and Perl). I
wouldn't want to be you if you ever have to modify your code some time
in the future.


More information about the Python-list mailing list