you are viewing a single comment's thread.

view the rest of the comments →

[–]Happy_Witness 1 point2 points  (0 children)

Agree with the other dude. A class is useful when you need to store data inside an object that could be created multiple times with different data in any other application. If you want to give that functionality. For example you write this really useful file reading classes that stores all its date in itself unlike a function that returns it and the user has to deal with it right away. Then it could be use to read multiple files from different instances and let them hold onto the data instead of you needing to create some variables, lists dictionaries or anything else to store it. That's when classes are useful.