Hacker News new | past | comments | ask | show | jobs | submit login

>>I prefer many things about Python over Perl

I have been doing Python a bit now and am of the opposite opinion.

Except for CPAN I miss the advanced stuff like Moose (better OO) and extensible syntax.

I might be too new to the language. E.g., I don't really get the list comprehension -- it looks like a kludge around the lack of multi line code blocks, so Python can't have nice a map() syntax. But people seems to love the that syntax, so there should be more to it than a kludge?

But sure, Python has a minimal and elegant notation; it just changes a bit too slowly.

Also, try posting a flame comment like yours about Python in a Python thread; you'd be at minus ten in five minutes and stupid comebacks would be up voted to orbit. The fanaticism makes RoR kids look mature.




List comprehension is one of those things I miss every I use another language. I am not sure what you mean with: it looks like a kludge around the lack of multi line code blocks could you provide and example?


Don't you know what map is? But you claimed to be an old Perl programmer?

I wrote "Python can't have nice a map() syntax", because of its lack of code blocks. And that list comprehensions seems like a one-statement kludge of the map functionality.

How could I have been clearer?

OK... second attempt to explain this point: :-)

List comprehension seems to me like a one statement replacement of a map function (and that one-statement often makes you think of Perl golf.)

And a third attempt: :-)

It seems to me that list comprehension would never have been implemented -- if Python had added (optional) support for ';' (+ '{'/'}') and hence code blocks. That is because Python would then use map() instead of list comprehensions (like all other scripting languages, lisps, etc).

(Also, a side effect of optional ';' support would mean that Python wouldn't be worthless garbage as a bash cmd line tool.)

But please enlighten me about use cases not done clearer/better with code blocks?

I note that you don't argue about the fan bois point... :-)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: