I do not want to defend OOP, but I would like to add that object-orientated languages are often to be expected to support these 3 things (encapsulation, inheritance and polymorphism) - at least many sources list these properties as must-have to be considered object-orientated.
> This is the kind of argument that convinces me that OOP is completely bunk.
Agreed. E.g. functional programming has a sound foundation (λ-calculus), but in object-oriented land if often sounds a little bit hand-wavy.
But most working programmers don't care about the debate at all in my experience. When they say they are looking for an object oriented language what they are really saying is:
I am looking for a language that has a syntax where you
can declare an object and call methods on that object
usually with a dot but sometimes with an ->.
They don't actually care about much more than that most of the time.But why? That's such a weird thing to look for. Clearly there's a reason they think they want "objects", but what is it? And why the focus on what syntax these objects have?
In Haskell you have to deal with the possibility of record types sharing the same field names.
These are three incredibly vague terms that pretty much every programming language can be said to provide. I can't understand how you think OOP is defined by this.
Do you think Haskell programmers are unable to reuse code? That they don't have any form of polymorphism? That they can't hide implementation details of functions, data structures and modules?
This is the kind of argument that convinces me that OOP is completely bunk. Its adherents can't even explain what it is!