Quote:
You're right, of course. I misspoke. What I meant is that (almost) everything the programmer works with is an object; with the exception of static methods (which are still classified within classes, which aids in the mental mapping of functional groups to specific classes), your code is always modeled as an interaction between objects.
Again,no. Programmers work with types(or classes) all the time, yet types are not objects in Java. You can't keep a list of types, for instance. How is then your code modelled as an interaction between objects, since one of the most basic building blocks(types) are not objects to begin with?
Quote:
you have a situation similar to (though of course much cleaner than) C++: you can write in an OOP paradigm, but the language lends itself more naturally to a procedural approach (at first, that is--you can do OOP just fine in Python, but from a pedagogical point of view you aren't hammered over the head with it--and I believe that you very much should be hammered over the head with it at first). With a proper instructor who's strict about enforcing the use of OOP where intelligent, Python is surely fine. But learning on your own--not so much, because the structure and framework isn't really there.
Putting a function inside the namespace of a class so you can say 'there, I used the class keyword' doesn't make your code more 'OO'. I don't understand how Python 'lends itself more naturally to a procedural approach'. It simply doesn't force you to use the 'class' keyword when it isn't needed and allows the definition of functions outsite classes. Well, many times this just makes more sense. Those free functions are objects themselves, which exist in the namespace of the module they were defined in, which in turn is also an object than can be passed around.
Say you have a function that takes a list of entities and returns the number of collisions between them. How is that implemented best in Java? You will probably have a Physics class and a Physics::FindCollisions(list) static method. What does that teach a beginner about classes? That classes are not only types, there are also namespaces we can dump functions in since we have to put them 'somewhere' and, well, classes is the only place code can exists since the language says so.
Take the similar situation in Python. You'd simply have a Physics modules that defines a FindCollisions(list) free function. That module can be passed around as a value, so you could have,say, 2 modules, one with impementation A and one with implementation B that implement FindCollisions(). You can even choose between those 2 modules at runtime, and the corresponding function will be called. Not tell me that this isn't more 'OO' than the static method technique, or that it doesn't teach better the notions of 'class' and 'module'.
Quote:
I am the wrong person of whom to ask this question, because I consider Python itself to be inelegant in general usage. I dislike the language from a stylistic standpoint, and I simply don't see any "elegance" in it whatsoever despite attempts to do otherwise. I can recognize its pluses, but the best answer to your question, for me, would be "I can't think of an algorithm that is more natural in Python, ever," because I...well...can't.
I didn't ask you to think an algorithm that is more natural in Python. I asked you the exactly opposite. An algorithm that is more natural in Java than in Python(that is, the syntax obscures the implementation of the algorithm as little as possible). Since you consider Python to be inelegant, you surely can provide such an example.