|
|
|
|
|
by dozzie
3817 days ago
|
|
So, Python regexps are suddenly more readable, even though they need
additional layer of backslashes? $_ does not rely on unreadable style. First, it's a common idiom, so it's in
no way less comprehensible than list comprehension in Python. You just need to
understand what it means. Second, it's not an obligation to use $_. I often
avoid it if it doesn't make my code reflecting my intentions better. Funny
thing, I do the same in Python, C, and Erlang. And I hear about $_ and regexp literals as unique selling points (if I read
your acronym correctly) only from people that don't really write in Perl. |
|
Python encourages a style that makes less use of regexps. (And you don't need extra backslashes, you can use r'...').
> And I hear about $_ and regexp literals as unique selling points (if I read your acronym correctly) only from people that don't really write in Perl.
Nice ad hominem. Go on then - what's your USP for Perl? Why should one use it over Python/Ruby/...?