Saturday 20 March 2021

The difference between class and object.

 The difference between class and object is subtle and misunderstood frequently. It is important to understand the difference in order to write cleaner class heirachies. 

First, the word "Object" is taken from Philosophy that is used to describe something that exists in the world around you at this very minute in time. For example; the computer in front of you, the keyboard you are using and yourself. 

Secondly, classes represent groups of these objects. A class called Keyboard represents all keyboard objects.

Class keyboard and its objects

 

Hopefully this has shown you the difference between an object and a class in terms of philosophy so that you know what should be a class and what shouldn't.

No comments:

Post a Comment

The difference between class and object.

 The difference between class and object is subtle and misunderstood frequently. It is important to understand the difference in order to wr...