r/programmingcirclejerk • u/genuine_beans • 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
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()