Double dispatch, aka the Visitor pattern.
-
-
-
I’m not even a fan of OOP but I have to admit I enjoy the visitor pattern for reusable traversals.
- Show replies
New conversation -
-
-
I find OOP good for anything that you're naturally thinking of in terms of objects in the first place, ex Game Objects. Simple example is its really nice to just have virtual update(); on your base game object, and loop through all of them calling that update
-
polymorphism in general, basically not multiple inheritance though, fuck that
- Show replies
New conversation -
-
-
If you consider OO to mean “late-binding”, then it’s basically separation of interface and implementation. One example is the Linux kernel file-system interface. Another is plug-ins for apps like Photoshop.
Thanks. Twitter will use this to make your timeline better. UndoUndo
-
-
-
I think if you actually have things and sub-types of those things in a game, and you're doing complex behaviour stuff with them, it does make sense. We used it a lot in StarTopia and I don't think we could have done it any more effectively with other paradigms.
-
I don't think using OOO was vastly simpler than something else (e.g. big switch statements), but it wasn't a BAD use of OOO and it didn't make the problem harder.
- Show replies
New conversation -
-
-
I think the best use of OOP is for data types that are naturally small and enclosed. The std library is a good example: vectors, maps, sets, etc. Things that are generally atomic.
-
Now std has a lot of bad press, but it is mostly due to self-inflicted limitations. For instance an std map can not move elements ever, so some implementations are not available, etc...
End of conversation
New conversation -
-
-
UI is a great example... modeling windows, labels, text fields, combo boxes etc. is perfectly suited to a class hierarchy.
-
Agreed. Considering all of the frameworks are OOP it would probably be more work to not use it.
End of conversation
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.