3 ms·
> Encapsulation, Polymorphism, And Code Reuse. These are three incredibly vague terms that pretty much every programming language can be said to provide. I can
by tree_of_item 9y ago
> Encapsulation, Polymorphism, And Code Reuse.
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!
- zaphar 9y agoI wouldn't call myself an adherent. If anything I'm an adherent to the idea that Objects are just another Closure and vice versa. The interesting distinctions are in how they achieve those same goals. 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.
- tree_of_item 9y ago> I'm looking for a language with "objects" and a syntax like <this> 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?
- zaphar 9y agoI'm not arguing this is a good thing. But I am saying that for the vast majority of programmers out there they use that pattern as a way of determining if they have those three attributes. It's cargo cult programming in a sense but it's also the only signal they've ever known.
- leshow 9y agoI think calling Rust that would confuse people more than anything. They will look for their traditional inheritance style relationships and be frustrated that there is not really any support for it. Better to teach the features that Rust actually has, than to try and fit some uber generic definition of "Objects" that's not going to serve newcommers.
- imtringued 9y agoCode organisation. Classes are basically used as datatype specific namespaces. In Haskell you have to deal with the possibility of record types sharing the same field names.
- protomikron 9y ago> 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. 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.