3 ms·
> It is a huge pain and tons of extra code to write a program in functional style in python, it is lacking basically everything I've had the exact opposite exp
by agentultra 13y ago
> It is a huge pain and tons of extra code to write a program in functional style in python, it is lacking basically everything
I've had the exact opposite experience. I write my Python code in a functional style by default. I use mutation as an exception rather than the rule. I find my code to be much more terse overall. When used effectively I find functional Python requires less code, not more as you imply.
- nousernamesleft 13y agoI suspect the difference of opinion is due to a different understanding of what a functional style is. Python does not have tail call elimination. You literally can not write lots of normal functional programs in python. Python doesn't have currying and requires explicit extra code to create partially applied functions. This makes functional programming painful and verbose. I think you are writing what I would call imperative code that uses some functional constructs where it is shorter. No doubt that is shorter than sticking entirely to imperative code, but it is a far cry from writing a program in functional style which requires that you not use imperative constructs.
- codygman 13y agoSome pythonistas get very annoyed when I do the same.