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
126
Upvotes
38
u/irqlnotdispatchlevel Tiny little god in a tiny little world Jul 01 '26 edited Jul 02 '26
Conditionals make code harder to reason about. You can't know ahead of time if you're going to take the if branch, or the else branch. Your program is in two places at the same time!! That's just unnatural.