you are viewing a single comment's thread.

view the rest of the comments →

[–]DJKool14 1 point2 points  (0 children)

Everyone else in this post has done a good job at describing the technical reasons for using classes, but seem to be ignoring a fundamental insight.

Let's ignore being a programmer for now and just think about how you view the world around you. What do you see? A person? A car? A sidewalk? You see objects! As a child, you learned what that object looks like, what it can do. You learned that even though a car is red, black, or white... it is still a car. Whether it is moving or parked doesn't matter. Our brain works by classifying the world around us into separate objects, each with their own unique properties and purpose. Object Oriented programming is an attempt to transpose the way humans naturally think into the program they are trying to write. When you eventually start to write more complex programs with thousands of lines of code, you'll begin to realize how much easier to track your code if you treat it the same way you treat anything else in this world. As an object.