[Chicago] Factoring fun with functions in Python
maney at two14.net
Sun Nov 18 00:37:12 CET 2012
On Fri, Nov 16, 2012 at 09:25:10AM -0600, Garrett Smith wrote:
> Let's be clear, the whole point of the exercise is to play with text.
> Whether it's pointless shuffling depends on what you're trying to
Ah, so then there's little to be said, since I don't see any point in
avoiding constructs that are painfully bad in Erlang when writing code
in Python. Which is not at all the same as saying FP has nothing to
teach us, but that's a whole lot different than just aping the form of
it (and if the latter isn't a Cargo Cult activity, what is?).
> "db.cursor()" is a method invocation on an object, not a function.
cursor = MySQLdb.cursor # this can't work, it's not a function.
cur = cursor(db) # ROFL when it does
> If you want to be proper annoyed, read the big brother to the OP :)
Actually, I think that was the problem: you seemed to make sense in
Erlang (I read both before I first tried to express what bothered me
about the Python version) so I was expecting something equally sensible
- a useful, analogous treatment in Python, to suit the very different
languages. As the old saw has it, you can write FORTRAN in pretty much
any language. But why do such a thing?
Now people have pondered this time and again (Who dies? Everyone dies)
We suspect that we're more than mere mortal remains (Oh, everyone dies)
Wise men and prophets they've all had their say
on the nature of our afterlives
But in case there's no beer there we'll have one more round (Oh everyone dies)
-- James Keelaghan in "Who Dies?", an upbeat song about mortality
More information about the Chicago