Quote:
Originally Posted by Ralph Sir Edward
O O - How do you change an object? Well... the object has the code that made it embedded as part of the object. You end up re-executing the code to get at the data, change the data, and re-encapsulate the data with the code. You think that isn't overhead? In a non O O language, you read the data raw, in your own data layout (or existing file layout you reuse), mod the data, and write. An order of magnitude less machine use. (But you have to know your data! (i.e. you have to know what you are doing.))
|
It's not always as bad as all that. C++, for example, can be written very efficiently, with minimal or no overhead over an equivalent C program.
I know purists will say that C++ isn't a pure OOP language, but it certainly includes OOP in the paradigms it supports, and it's certainly possible to write in an OOP style in C++.
/JB