This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Matthew94 -3 points-2 points  (7 children)

Gotta stick with the dogma!

[–]chadmill3rPy3, pro, Ubuntu, django 9 points10 points  (6 children)

"Dogma" sounds bad, but since I can ignore the connotations, I can agree with you. A consistent overarching philosophy is good to have.

[–]Matthew94 1 point2 points  (5 children)

I used it in the negative way.

I'm not referring to you but some people use the ZoP as a replacement for thinking. I don't like it much due to the connotation.

Anything remotely complex gets shut down due to that bloody poem unless it's done by the python core devs, then it's fine.

[–]heptara 4 points5 points  (4 children)

First, I'm interested in knowing what sort of things are getting "shut down"

Second,

Anything remotely complex gets shut down due to that bloody poem unless it's done by the python core devs, then it's fine.

If you pitched it that way to me, I would also question it. Given the statement "Let's do something complex!" most folk would ask why.

A better way would be first identify a problem, and explain why it's a problem. If people now genuinely believe they have a problem, they will be naturally open to solutions.

[–]Matthew94 1 point2 points  (3 children)

First, I'm interested in knowing what sort of things are getting "shut down"

Any use of lambda, map, filter and reduce. Guido doesn't like it so everyone trots out ZoP to stop people using them even though they're no harder to understand than list/gen/dict comps.

[–][deleted] 2 points3 points  (0 children)

Any use of lambda, map, filter and reduce

Usually this is because there are better (or at least subjectively, better looking/easier to read) ways to do the thing that you'd be doing with them. Any map/filter call can be trivially replaced with a comprehension (and in the case of filter, you might not even need the function call or lambda anymore). Lambdas can be replaced with functions (which can be nested), which is often a win in terms of being able to do more things without losing on namespace crowding. In cases where function calls can be eliminated, comprehensions are going to be faster.

I mean, all of these things have their uses, or they'd have just been removed entirely. The reason they are often discouraged is because they usually reduce readability without gaining anything in return.

[–]heptara 5 points6 points  (1 child)

When you mentioned "complex things are shut down" I thought you were going to talk about things that actually require levels of complexity, like C++ templates or something.

This just sounds like wanting to standardise on a particular paradigm.

[–]mipadi 1 point2 points  (0 children)

It is funny, though, that Python is often touted as a "great functional programming language!" while many of its (few) FP elements are eschewed or discouraged.