Look, I love functional programming. I use it all the time and I procrastinate in the shower about the best to add currying to all my favorite languages. That being said, even after all those years, I still find this:
expr, res = "28+32+++32++39", 0
for t in expr.split("+"):
if t != "":
res += int(t)
print res
SO MUCH more readable than this:
from operator import add
expr = "28+32+++32++39"
print reduce(add, map(int, filter(bool, expr.split("+"))))
A couple years ago I created a library called Moka in python to make functional and nesting easier. That would be written this way:
(Moka(expr)
.do(string.split, '+')
.keep(lambda x: x != "")
.map(int)
.reduce(moka.add))
Still, the imperative version, althought it has state and feels hacky for a functional hacker, is still pretty damn clear and easy to read.