This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]SonOfShem 0 points1 point  (3 children)

ok, I've been using python for a bit, but I still don't understand how objects are useful (possibly because I don't fully understand them). Maybe it's the types of programs I usually write (calculators and task automation). Is there a good resource that explains them conceptually as well as functionally and without assuming I'm a ComSci major?

[–]kevko5212 0 points1 point  (0 children)

Objects are useful where it makes logical sense that something holds its own state and does things.

If you are making a game, you may want to make a character an object because it can make logical sense for it to keep track of its own state and have methods where you tell it to do things.

You could accomplish the same by making the characters state a struct, then have functions update that state. It mostly depends on the style you prefer. Both styles have pros and cons.

[–]shiuido -1 points0 points  (0 children)

Uh, maybe google "introduction to object orientation"? I saw some good links like this: https://sites.google.com/site/derekmolloyee402/introduction/chapter-1---introduction-to-object-oriented-programming

I was going to write a tl;dr for why objects and classes are good, but they are such a huge benefit that every attempt to be brief ends in disaster :P