Searching for the best scripting language,

Peter Hansen peter at engcorp.com
Mon Jun 14 15:27:31 CEST 2004


Ryan Paul wrote:

> 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}`} }

This is proof of something, I'm sure, but for me it's simply another
indication that (a) Ruby is more like Perl than it is like Python,
(b) unreadable code can be written in any language, and (c) I
really don't mind using 15 lines to write something if it means
the resulting code can readily be understood.

Thanks for reinforcing my lack of interest in switching to Ruby. :-)

-Peter



More information about the Python-list mailing list