Remix.run Logo
Spivak 6 days ago

What do you mean by this? Because everything in Python is object, even classes and functions are objects.

Do you just mean that Python lets you write functions not as part of a class? Because yeah there's the public static void main meme but static functions attached to a class is basically equivalent to Python free functions being attached to a module object.

lisbbb 6 days ago | parent | next [-]

OOP is not shoved down your throat with Python, though. With Python, I can choose what taxonomies deserve an OOP treatment and which do not. Spoiler: Almost nothing is a taxonomy of any remarkable nature.

JohnMakin 6 days ago | parent [-]

you also can get away with completely ignoring the underlying oop semantics in tons of cases whereas java and similar languages dont give you that option

fc417fc802 6 days ago | parent | prev [-]

If I call something a function does that mean I'm "doing functional programming" any time I use it?

I use both C++ and Python but I wouldn't describe any of what I write as "object oriented".

lisbbb 6 days ago | parent [-]

No. Functional programming is quite a bit more involved than just writing "functions"--it is taking advantage of the fact that functions are first-class "objects" that can be passed as arguments to other functions, which allows for a far more intuitive and flexible form of programming. But FP is even more than that.