re: Rust, Iterators, and Skill Regression VIEW POST

re: Last week I was fucked up, I need to tear down some connection in Python and this is what spawned out of my normal functional programming brain: ...

Well in general, I would say that in Python at least, you should probably almost never need the map function. If you’re using map, you probably want a for loop or a list comprehension. Especially if you’re not using the result of the teardown function, it probably ought to be:

for connection in connections:

What do you think?


Thank you, I knew it and did it since the first days I learn programming. It's more a matter of preference, the functional programming way seems more natural and straightforward to me.

IFAIK, FP isn't a recommended paradigm in Python, even Guido has said he wants to remove map, reduce and filter. Now I think he's right, anyone wishes for FP favor should use a third party module rather than rely on the standard library.

Code of Conduct Report abuse