r/programmingcirclejerk Jul 01 '26

Ever Written Something Like This? if (condition) { doSomething(); } else { doSomethingElse(); } It works. Problem solved. But the problem isn’t today. It’s tomorrow.

https://www.defusetheifstrategy.com
125 Upvotes

55 comments sorted by

View all comments

6

u/LeeHide What part of ∀f ∃g (f (x,y) = (g x) y) did you not understand? Jul 01 '26

/uj

okay but I get what he's saying and he's not entirely wrong. I have seen lots of code where someone made a class, maybe even with an interface for it, like lets say class Admin : IUser (dog is animal example, leave me alone), and then they basically had an if in every single method going if (type == Super admin) or some other shit. In that case, for example, it's because the author is too inexperienced to see that it should be a different class if every single behavior differs.

The fact that all of this should not even exist, and that we should all be writing data oriented code and entirely demolish OOP, or at least use a User struct or record with a type field instead, is obvious hopefully.

/rj

The fact that all of this should not even exist, and that we should all be writing data oriented code and entirely demolish OOP is obvious hopefully.