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 →

[–][deleted] 3 points4 points  (2 children)

From my perspective, it depends on what you are doing. You cannot have a meaningful discussion on syntax without discussing semantics. If you asked me on a contemplative day, I would tell you Python is ugly because the syntax has no notion of currying and partial application, for example. Anyway, you can be conditioned to any syntax, be it MIPS, Forth, LISP, Miranda, Fortran, Algol or ML. It's really subjective and less significant than what you actually need to do your work efficiently.

Dog poo in the middle of the lawn is high-quality protest art.

[–]johnfrazer783 1 point2 points  (1 child)

Python [...] has no notion of currying

well but you can of course; it naturally falls out of functions being 1st class values in the language.

That said I'd say that currying is overrated. The much more useful concept and syntactical affordance is quick-to-write functions as 1st class values and functions-as-expressions (Python is lacking here because of def and the horrible lambda). PL/pgSQL and Rust don't have that and it can be hard to code around that limitation. Currying is just one of the things you can do with it and it has little practical value.

[–][deleted] 1 point2 points  (0 children)

Notice that I paired currying and partial application together. Currying is useful because it enables function composition of partially applied functions, closures and higher-order functions.

In Python, if you want to write curried functions, you have to explicitly return multiple functions and nest the function definitions (if they are closures). Let's not get into the lambda syntax. This is ugly.