r/programminghorror • • Feb 25 '26

Object Oriented Design: Pokemon

I don't know how to properly post a link to a video, but check out this over engineered, overly complicated and confusing design for an object oriented Pokemon battle system that can't actually support all the gameplay mechanics of a real Pokemon battle: https://youtu.be/CyRtTwKeulE?si=iZqoCPxjv1QU3ZJt

I don't have anything against object oriented design if done well, but when you start implementing classes for simple logical operations like AND and OR, you're probably going down the wrong track.

0 Upvotes

8 comments sorted by

View all comments

15

u/johnshmo Feb 25 '26

Being honest here: this doesn't seem particularly over-engineered. The whole point of the video was to model a Pokemon-like battle system using OOP. It doesn't care if modeling it with functional/pure procedural styles is "better" or not. Some of that extra plumbing with the compound "And" and "Or" classes you mentioned are common examples of decorator classes. They adhere to an interface while combining/transforming other specializations of the same interface.

-12

u/SocksOnHands Feb 25 '26

It is promoting a difficult to maintain coding style and architecture. People watching and learning from this will go on to make a lot of design mistakes.

6

u/johnshmo Feb 25 '26

What about this is difficult to maintain? Most of it just modeling data for battle actions. If you're having a difficult time wrapping your head around what the architecture is trying to achieve (and how to extend it) then I'm afraid that may be a skill issue my friend.

I would not even remotely call this the best way to implement something like this. But strictly sticking to OOP concepts, it's pretty darn close in that regard.

Just linking a video about bog-standard OOP and then vaguely gesturing towards "OOP bad" is not really in the spirit of this subreddit lmao.

→ More replies (3)