[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: pyton & perl



On Sun, Apr 01, 2001 at 05:57:50PM -0700, Robert Cymbala wrote:
> 
> Can't just split lines in Python?  Splitting lines where it's logical
> to do so is possible.  Here's a sample, created with CPython mode in
> Emacs.  The entire script is at:
> http://www.lafn.org/~cymbala/photospy.html
> 
>  131            # Create an "alias" down to the sent layer.
>  132            self.info['data'][
>  133                self.info['roll_number_max']][
>  134                'sent'] = {}
>  135            sent = self.info['data'][
>  136                self.info['roll_number_max']][
>  137                'sent']

    I didn't say you couldn't split lines. I said you couldn't do it
necessarily where it's logical to do so. I do not find the above code splits
lines at logical points. It is making use of the open parens to split lines,
when personally, I would never split across an open paren like that. I find it
difficult to read. 

    Typical perl for me

    my @files = sort 
                map { $dir . "/$_" }  
                grep { !/^\./ } 
                readdir DIR;

    I find this far more readable, but that's me. 

    Mike

-- 
Michael P. Soulier <msoulier@storm.ca> 
"With sufficient thrust, pigs fly just fine. However, this is not necessarily a
good idea. It is hard to be sure where they are going to land, and it could be
dangerous sitting under them as they fly overhead." -- RFC 1925



Reply to: