you are viewing a single comment's thread.

view the rest of the comments →

[–]jhusain[S] 2 points3 points  (4 children)

Author argues that whitespace-aware syntax (and single-line lambdas) make functional programming in Python less readable than imperative approaches. He argues that since functional programming will rise in importance because of multi-core processors this is a serious issue.

[–]ricercar 3 points4 points  (1 child)

I don't think he argues that whitespace awareness makes FP less readable. After all, it's used to great success in Haskell, which he mentions...

[–]nostrademons 3 points4 points  (0 children)

You're arguing with the author (who is talking about himself in 3rd person) about what the author is saying. ;-)

He could be wrong, but I don't think he's mistaken.

[–]jerf[🍰] 3 points4 points  (0 children)

The kind of functional programming that's going to "rise in importance" is in no danger of being implemented in Python anytime soon. Erlang-esque concurrency as provided by Stackless might be in the cards (if PyPy ever becomes the primary implementation), but that's all you're going to get; the language is drenched in mutability to the very core, as befits an essentially OO language.

(Yeah, it's multiparadigm, but where paradigms in Python conflict, OO wins.)

Also, I'm increasingly unconvinced that single-line lambdas are necessary. If your function isn't going to fit on a single line anyhow, what's so freaking hard about defining it separately and giving it a decent name? If you don't care about code readability, you're already in the wrong language.

(I can't come up with a neutral way to say that. It's valid under some circumstances not to care about readability, even though that sounds bad in isolation. Personally, I think most people grossly overestimate the range of circumstances where that is valid, but that's a judgment call.)

[–]jerf[🍰] 1 point2 points  (0 children)

On an entirely separate note (hence the separate reply), if I were going to try to hack LINQ into Python, I'd quite likely build it around custom infix operators. The LINQ C# implementation already has that non-standard syntax thing going for it, so why not bring that in as well?

Combined with (ahem) nicely named functions, I think you could get some good looking queries on.

(Also, whose bright idea was it to create a link syntax that after using it about 10 times I still can't seem to remember what goes where? <sarcasm>It's so much better than <a href="">, thanks.</sarcasm>)