« first day (4013 days earlier)      last day (1239 days later) » 

15:12
@AndrasDeak Students have problems knowing what is a file and a directory.
 
2 hours later…
17:28
@AndrasDeak This is a fairly characteristic Adam Cadre essay, adamcadre.ac/calendar/17/17405.html
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".
17:46
thanks for the tip
@AndrasDeak Don't feel obliged to actually read it.
I don't ;)
But I might. A recommendation can never hurt.
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.)
Functional programming relies quite heavily on functions being objects. And of course there are languages where they aren't.
17:56
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.
I was just remarking that as far as I can tell, functional programming idioms aren't that popular with Python, so no doubt I've been affected by that.
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.
Also, I haven't done much programming in recent years.
I suspect python having first-class function is, as Andras says, a side effect of the fact that almost everything in python is
17:58
@AndrasDeak Well, yes. But it's hard for that approach if a function isn't an object in the first place. It's sort of a prerequisite.
(and it's useful for e.g. any API that involves callbacks, which includes a lot of programs that use embedded python)
@FaheemMitha yes, but not the point. Just a natural requirement.
@ToxicFrog I guess so.
functional language --> functions are first-class
functions are first-class -/-> functional language
BOOM, logiced
@AndrasDeak I'm not sure what "the point" is. And I already said it was a requirement. More or less. I'm not sure if it is a strict requirement.
Like its cousin, Lisp, Python is designed to be fairly flexible. And it is, in most respects.
More than many competitors, at any rate.
18:00
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.
Try programming in R, for example.
@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.
18:37
Incidentally, this is the "Road to Wigan Pier" review I was talking about -> adamcadre.ac/calendar/12/12353.html
It's really very funny. Though, of course, it helps to have some background to appreciate it.
 
2 hours later…
20:59
I don't think functional programming languages require first-class functions, though it's not a strongly-defined category
Neither is first-class function, I suppose

« first day (4013 days earlier)      last day (1239 days later) »