Hacker News new | ask | show | jobs
by Izkata 31 days ago
Python is an object-oriented language in the broader meaning, but object-oriented programming is a particular style that java pushes you into, that python doesn't. It doesn't just mean "everything is an object", it's more like "everything is done in terms of objects that contain data and functions (methods)". Python has objects and could be done in that way, but a more basic imperative style with functional programming elements is more common, where objects are just one component instead of the driving force.
1 comments

Java has better support for non-OOP paradigms than Python does. Map, filter, and reduce are built into the language rather than exiled to an external library. It supports multiline anonymous functions, and it has block scoping, so there are fewer surprises when using them. Java also has record types, exhaustiveness checks in pattern matches via sealed interfaces, built-in types for managing effects and errors (Optional<>, Try<>, Result<>), and type inference. It also has excellent interop with multiple programming languages where pure functional programming is idiomatic. It's a way more comfortable language in which to do FP than Python is.