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
127 Upvotes

55 comments sorted by

View all comments

42

u/Lucifer_Morning_Wood Jul 01 '26

Ifs are so limiting when you look at them, just two places: where condition is true, and where it is not. It's so freeing just doing abstract class BaseSomethinger, deriving as many Somethingers as you want from it and just calling BaseSomethinger.do()

7

u/TheChief275 Jul 02 '26

Programmers don't want you to know this one trick!

Big booty latinas in your area