A meditation on the futility of human existence, in the guise of a book review.
At least, I think it's a book review.
No, graphic novel actually.
When Adam actually bothers to write a proper review, they tend to be among the best, if not the best I've read of that particular work. And he often has very insightful things to say. My possible favorite is his hysterically funny review of "A Road to Wigan Pier".
Well, it's not like his best work or anything. Not even close. Just a representative essay I was looking at.
Apparently Python's functions are first class. I've barely noticed, and hardly ever made use of that. I wonder why. Functional idioms don't seem very popular with the Python community. Perhaps that's why.
I think it's not that "functions are first class". It's that everything* is an object.
functions are first-class, classes are first-class, types are first-class...
Then again I don't have an understanding of "first-classness" beyond "you can pass function objects around. Most such named concepts are overrated in my opinion. (But that might just be my non-CS-personness showing.)
My impression is that's just a technical aspect of functional programming, and the real point of functional programming is approaching problems in a completely different way.
Python does support some functional idioms in the stdlib (map, filter) but they are generally considered non-idiomatic compared to list comprehensions, and of course python's lambda is fairly restricted
But yes, python is not great for functional patterns (both from a style and from a performance standpoint). But sometimes it's useful to be able to pass functions around. One famous example is the concept of a dispatch dict.
My limited experience is that concepts like "object" can be very domain-specific, so I wouldn't try defining things in terms of that. At the end of the day programming paradigms and languages can be different enough that terminology for patterns in one language are not applicable to another language. Case in point: python's model for passing function parameters.
@AndrasDeak first class rather than object, if you prefer.
I suppose object is a vague term.
I happened on this train of thought when writing some Lua code, where I was forced to adopt a functional idiom to do what I needed to do. But I don't know if I would have tried the same approach in Python. Probably because Python has more alternatives than Lua.
Often one winds up using home-made pattern matching in Lua out of desperation, when in Python one would just use a library.