4 ms·
Programming is about state (variables, constants, data), and behaviour (algorithms). State and behaviour are deeply intertwingled, and object orientation seeks
by cabalamat 18y ago
Programming is about state (variables, constants, data), and behaviour (algorithms).
State and behaviour are deeply intertwingled, and object orientation seeks to make programming easier by acknowledging that fact.
Put simply: an object is something with state and behaviour, and an object-oriented programming system is one that makes working with objects easy.
Two ways they do this are information hiding (so you can consider an object a black box and not care about its inner workings) and inheritance (when two objects are similar, you only need to specify the differences between them).
- parenthesis 18y ago[In a similar vein, I was about to say:] Object-orientation is fundamentally just a way of organising programs. In most non-OO programming, you've got a bunch of data, and a bunch of procedures that can operate on the data. The two are defined and considered somewhat separately, though they must fit together. In OOP, a kind of datum and the operations on it are instead designed, defined and used together, as essentially linked.