a section of the code that is self-contained that lets you make multiple instances without having to copy the code a bunch of times.
Software developers are basically lazy.
-> This is mostly a virtue. Saves time. (Industrial Revolution) More likely to be correct (more pieces is more complicated to get right)
class is a blueprint for an object. functions don't have very good access control. Functions do actions, but objects have information that you can store that you can access later.
Objects are templates for an abstract idea. Functions are static.
Objects -
- have an inside and an outside.
- they allow for the reuse of an idea
- they may have internal state. that may be changed. (immutable objects cannot be changed)
- properties (things they have)
- methods (things they do)
Object - Based Design allows for the above mechanisms. "has" properties & methods.
Object Oriented Design - 'is a' relationships are allowed to describe how objects are connected.
7 +/- 2 rule :