3 ms·
It's true that there's no definition of "object oriented" that fits every language that has "objects". But that also means that the term "OOP", without the cont
by andor 12y ago
It's true that there's no definition of "object oriented" that fits every
language that has "objects". But that also means that the term "OOP", without
the context of a language, is useless in discussions, because it doesn't mean
anything.
Like Java, Go and Javascript have "objects", but you all know how different
they are. So don't make them equal by calling both of them "object-oriented".
If structs in C were called "objects", would C be object-oriented as well?
- seanmcdirmid 12y agoGo is fairly OO in its own 1970s style. JavaScript is definitely OO and not many would argue otherwise. C is not: struts don't support encapsulation directly. However, many have invented or reinvented OOP in C (including me) with void* and hand rolled virtual dispatch tables (you can even find that in Linux). Heck, how do you think the first C++ compiler was written? And you could of course do objects in assembly...it's even easy given a few macros. [1] OOP is simply programming with objects. If you have values that contain encapsulated state, and you are instructing them to do things with that state, you have objects and are doing OOP. You can do that in any Turing complete language, but some languages support it better than others. [1] http://www.drdobbs.com/embedded-systems/object-oriented-programming-in-assembly/184408319 http://www.drdobbs.com/embedded-systems/object-oriented-prog...