Tuesday, December 19, 2023

The difference between Object Oriented and Imperative programming

At its heart, programming is applying functions to data.  In normal people speech, verbs acting on nouns.  But which verbs are allowed to act on which nouns?  This question defines the split between object oriented and "standard" imperative programming.

Imperative:  verb(noun)
Verbs (functions) have a list of nouns (data types) which they may act upon.
Functions are applied to data.

Object Oriented:  noun.verb
Nouns (object classes) have a list of verbs (methods) which may act upon them.
Objects contain functions.

That's it.  That's the difference between these two programming styles.

No comments:

Post a Comment

I reserve the right to remove egregiously profane or abusive comments, spam, and anything else that really annoys me. Feel free to agree or disagree, but let's keep this reasonably civil.