new linereading standard?
Johann Hibschman
johann at physics.berkeley.edu
Wed Apr 26 22:16:55 EDT 2000
Juergen A Erhard writes:
>>>>>> "Johann" == Johann Hibschman <johann at physics.berkeley.edu> writes:
> [J W B]
Johann> So, basically, I find the functional stuff much more
Johann> useful from the command line than I do from actual
Johann> programs. I think of the right transform, then I apply
Johann> it. Interesting.
> Actually, I find the third example more readable than the other two...
> map(string.strip, lines)
> is, IMHO, more readable than a for loop doing the same.
I agree. For a single operation, that is. However, I find a for loop
expressing successive transformations of a single data item to be
easier, once things get more complicated than a single map. Just
taste, though.
> Though it also depends on what you're used to... (maps etc are *more*
> readable in Lisp... than in Python)
But even in Lisp (by which I assume you mean Common Lisp), I find that
dolist and the loop macro are often more readable than using mapcar
and friends. In Scheme, you don't have dolist and loop, and I find
readability suffers. (I'm not so certain about loop; it's a monster.
But I like dolist.)
Thinking vaguely that if Common Lisp were more common, python wouldn't
be nearly as clear a win as it is...
--Johann
--
Johann Hibschman johann at physics.berkeley.edu
More information about the Python-list
mailing list