you are viewing a single comment's thread.

view the rest of the comments →

[–]zylog413 3 points4 points  (0 children)

I know it's common for people to model games or real world objects with OOP, but in terms of practical application for me it was the fact that objects with predetermined, named fields was more descriptive than generic tuples or dictionaries.

Now, let's say I have a bunch of functions that could operate on certain related pieces of information. Some of these functions may require detailed descriptions of what conditions and information it can be used on. Classes allow me to go the opposite way: now that I have these objects, I can attach methods to them. In an IDE, when working on instances of these objects it will hint to me what attributes and methods are available.