Thats the biggest flaw of OOP. Data and code should not belong together. It may be easier for a human to think about an object which encapsulated the code and data it operates on. But it's fundamentally not how the computer works. You got code, which operates on data. The abstraction layer of combining them together just decreases your performance and for me personally is harder to understand than writing code which operates on data, which exists independently from the code.Rinzwind wrote:Most just want a convenient way to structure data and its behaviour.
And that OOP performance is a real world problem is proven by the "new" approaches taken to increase performance of games, they call it data driven programming, which breaks away from the concept of combining data and code into objects. It's also used to drastically increase browser performance as traditionally everything in browser coding is an object.
In my experience this "simplification" in coding is just an illusion. I agree it's easier to handle multiple instances of things. However it's also not particularly hard or much work to implement it with the procedural style. In the end you just tade some coding simplifications for performance and more problems down the line. You spend much more time on the origanization of your objects, which for me defeats the purpose of a abstraction layer, which OOP is supposed to be. Abstract parts of coding for convenience. However that convenience is very shallow and bites you back later when your biggest worry is how to organize your object classes and how they should communicate with each other. You start to add code in just to handle how objects interact with each other, that need to interact. In the real world you never have a perfect hirarchy where your flow just trickles down a tree, but that is what OOP wants you to have. If you start to use cross references and manager objects, you realize your code isnt actually more reusable as procedural code as you got a ton of dependencies between objects.Rinzwind wrote: which can be immensely useful to simplify coding.
That said, i am not against optional additions which enable easier use of OOP. However it's not required at all in my opinion.