4 ms·
In my experience what matters is the quality of the code regardless of the paradigm used. A well written piece of functional Python with comments and documentat
by ilovecaching 8y ago
In my experience what matters is the quality of the code regardless of the paradigm used. A well written piece of functional Python with comments and documentation will be much easier to understand than poorly written OOP.
FP is also quite idiomatic. Pythons list comprehensions are quite powerful, and the libraries I mentioned in my previous comment are all part of the standard library. There are third party libraries that attempt to make Python even more functional.
- olavk 8y agoWell written code is obviously better than badly written code. But why assume the functional-style is better written than the idiomatic Python? I think a good developer understand the context they work in rather than try to fit a square peg in a round hole. I wouldn't like to maintain Haskell code written by someone who thinks everything should look like Python. And vice-versa.
- ilovecaching 8y ago> square peg in a round hole Python is a multi-paradigm language. I have not found Python to be better at OOP versus imperative or functional styles of programming. For me, functional programming provides a closer to model to how I think about problems. This is true for many people. One should choose the style that provides the easiest translation of thought to code.
- olavk 8y agoIf you only write code which you yourself will read and maintain, then you should definitely do whatever you feel works best for you and matches your way of thinking.
- wrmsr 8y agoPython's lambda is very intentionally limited precisely to steer people away from overly functional code. Don't write Haskell in Python, and equally don't write Java in Python.
- tarboreus 8y agoPython code doesn't have to be OOP to be idiomatic. That said, functional code that uses lambdas, map, etc. is generally not idiomatic Python. I've seen a lot get done just with functions, list comprehensions, and Python-specific magic without using OOP, though. Guess that's mostly just imperative on steroids, though.
- rptr_87 8y agoI’m currently working on a large C++ project... which has layers and layers of indirections... It’s so hard to even check where the actual implementation is.... There are no comments in code, no documentation whatsoever...