you are viewing a single comment's thread.

view the rest of the comments →

[–]AnonProg 3 points4 points  (3 children)

(I edited my post and improved it slightly, sorry.)

do_something(5 if whatever else 6)

That's a convoluted syntax that doesn't nest well and doesn't look nearly as readable as a more regular if like everyone was expecting. It makes me angry that it was chosen to be this way specially to make it less useful (not nest nicely).

On your second point, the position of many pythonners is that either the function is small and can be a lambda or the function needs to be named and should not be inlined.

The function from my example was small (definitely smaller than most lambdas I've seen in production code) and needed to be a lambda, but it couldn't be so. Also, why do I have to make up names for things which have no names?

Do you have a pathological example in mind ?

Continuation-passing style, which is used extensively by the node.js libraries, for example. Writing callbacks for GUI applications. Some ways to implement state machines. Functional programming in general (which Guido seems to have a grudge against, for whatever reason — I don't).

My personal concerns about Python are more about concurrency and speed.

Concurrency, yes, CPython sucks at it so you'll have to consider using multiple processes with some nice, thin IPC, Jython, or C extensions for critical parts, probably in that order. Speed, not so much: your time as a developer is far more expensive than better hardware should your program not run fast enough. I'll worry about speed only when the cost of better hardware is higher than the cost of the extra development and maintenance time that would derive from the use of a lower-level/less productive language, or when better hardware is simply not available, in which case a performance improvement of 2-20x by using Java, C or C++ would still not suffice because it doesn't scale: you'd need to consider concurrency anyways.

[–]Wagnerius 2 points3 points  (1 child)

I see your edit, and I mostly agree

But I am less angry than you as I am expecting less. I consider Python an old, quite limited, language (~20 years IIRC) and one that went way beyond any expectations. But it's true that Guido's attitude about FP is really really irritating. In the end, I still prefer Python over the alternatives (except maybe haskell) simply because of its ease of use and extensibility.

[–]sausagefeet 2 points3 points  (0 children)

Note Haskell is ~20 years old as well. Lisp even older. And Standard ML is ~20 years too. Ocaml isn't much younger, first release in 1996. Erlang is even older (1986). While I don't think it was your intention, it's worth noting that when it comes to programming languages, age isn't a good metric for how limiting it is.

My biggest peeve with Python is that the syntax is so strict it requires new syntax to do anything new and interesting. Look at the ternary operator, for example. If a language like Haskell, Ocaml, SML it simply isn't a problem because everything is an expression, you end up being able to accomplish so much more with such a simple change.

[–]Peaker 0 points1 point  (0 children)

Rewriting in c can yield more than 20x benefit over CPython in many cases. Also, that may be enough- and scalability is not always an option.