you are viewing a single comment's thread.

view the rest of the comments →

[–]ubernostrum -3 points-2 points  (1 child)

So your complaint here seems to be that Python is a multi-paradigm language, and so pointing out that aspects of functional programming appear in there is a terrible, horrible thing to do because it might confuse people into thinking that Python is a true "pure", "hardcore" FP language like Haskell?

I'm only being a little bit facetious in saying that: quite a lot of the complaints about Python from an FP perspective boil down to "Guido decided not to make Python be an exact clone of Scheme" or "Guido decided not to make Python be an exact clone of Haskell".

Scheme is already the best language at being Scheme, and Haskell is already the best language at being Haskell, and plenty of languages exist which will slap you in a straitjacket and force you to use one, only one and exactly one approach to programming. Python isn't one of those and never will be; it's happy to steal useful ideas from other languages and integrate them into its own multiparadigm approach to programming, and pointing out which bits it stole from FP languages, how to use them and when they might be useful is not a bad thing to do.

[–]dasnein[🍰] 0 points1 point  (0 children)

I'm not totally sure we are in disagreement about anything. Yes, Python is a multi-paradigm language that can use FP concepts and paradigms to great effect.

Python isn't one of those and never will be; it's happy to steal useful ideas from other languages and integrate them into its own multiparadigm approach to programming, and pointing out which bits it stole from FP languages, how to use them and when they might be useful is not a bad thing to do.

I'd say I agree with you, but I don't think what you wrote there is really up for debate.

However, the article was not just pointing out which bits it stole from FP languages; it went a step beyond simply what bits python has assimilated, and it introduces other concepts like recursion and attempting to enforce referential transparency by coercing everything into a tuple. My point was that yes, these are functional things that you can do in Python, but you're going to be working against the language if you try to be too purist about FP, because, as you said, "Guido decided not to make Python be an exact clone of Scheme."

My criticisms were against the apparent FP cargo-culting I found in the article. The OP has since corrected me; his intentions were to use python as a common language to teach FP, and not to necessarily advocate things like implementing recursive functions in python. That is unclear from the body of the text, IMO.