3 ms·
> Just like a method is usually dependent on the instances data or a function is dependent on the data passed in. Just like a C function operating on a C struc
by dkersten 5y ago
> Just like a method is usually dependent on the instances data or a function is dependent on the data passed in.
Just like a C function operating on a C struct. So, what, in your opinion, is the difference between procedural programming and OOP?
> It's mostly syntax.
Which is why I think there is more to OOP than a classes attributes and it’s methods. There is also inheritance, encapsulation levels, the fact that an objects identity is its attributes (the object is its data, an entity has its components but is separate from them), the fact that an object is a singular thing which it’s methods operate on (as opposed to how systems operate on collections of components, imagine a class system where a method operated on all instances of that class!).
Sure at the end of the day it’s all the same and we’re just arguing semantics, but that was my point and what I lead with: it’s an overly broad definition. If definitions are too broad then they really don’t add any value, but I believe a distinction between OOP and ECS is useful because they are used in different ways.
But fundamentally I don’t disagree, I even once wrote a blog post about how all of the OOP principles exist in an ECS! I just don’t believe that thinking of them as slightly different implantations of OOP is useful because of how their properties differ.
- meheleventyone 5y agoI actually wrote way back at the start about encapsulation and inheritance (along with message passing). So I'm not sure my definition really is overly broad. I'm also mostly talking about the runtime consequences of the things that most people worry about at the time of programming. But thanks for making me defend my thought!