On 9 June 2013 02:39, Walter Bright <newshound2@digitalmars.com> wrote:
On 6/7/2013 8:59 PM, Manu wrote:
Because they embody functionality, not just data. That's just how many many
programmers write code.
Go to university for a couple of years, see what they tell you... ;)
Some of these systems can effectively be considered plugins. Consider
OpenGL/DirectX? DirectSound/XAudio? Linux has a million back-end API's to choose
from.
I can see why many people feel it's natural to design their API's/systems that
way, right or wrong.


So they don't need to be classes at all. It's not about embodying functionality vs data. It's about having a value type vs a polymorphic ref type.

Hey? I'm not sure what you're saying..
I just said that people do use classes. And that implies a ref type with some amount of polymorphism.
These API's are reference based, and there is always a few virtuals. And these are just trivial examples, a large game unifies a lot of code from basically all fields of computing.
Trust me, I wouldn't bother spending all this time making a noise about the performance characteristics of classes if we didn't want/use classes.