3 ms·
> What both of those have in common, though, is the idea of an "object", which is a bundle of a data structure plus code. In general, the associated code is the
by globular-toast 5y ago
> What both of those have in common, though, is the idea of an "object", which is a bundle of a data structure plus code. In general, the associated code is the only code that can modify the data in the structure.
But you can do that in C. The argument for C not being object oriented is that it does allow you do stuff that isn't object oriented, but you just said yourself that even so-called OO languages allow you to do that anyway.
Object-oriented programming is a thing that C lets you do. It's fine if it lets you do other things too.
You should check out Common Lisp's CLOS which is the best object-oriented framework I've ever used. It's nothing like the "bundle of data structure and code" you describe.
- AnimalMuppet 5y agoWell, no, C lets you do that stuff completely manually. C is not object oriented because it gives you zero help in programming in an OO style. It doesn't forbid it, but it doesn't forbid much of anything. As opposed to C++, which gives you a bunch of tools to help you, and to Java, which forces you.