you've been doing formal logic your whole life!
within a month of attending college in the Bay Area, I was exposed to the complex world that is computer science and startups. and after taking an Intro to Logic class, I realized something: every programmer who has ever written an if statement has been doing formal logic. basically, computer science is made up of something philosophers were writing down in symbols centuries ago.
and the most fundamental piece of that structure? it's called modus ponens, and you've probably also been using it your whole life without knowing it had a name!
in everyday life, it looks like this:
if I have an exam tomorrow, I should study. I have an exam tomorrow. ∴ I should study.
or in code:
if (examTomorrow) {   study(); } // examTomorrow = true // → study() runs
the if/then is modus ponens.
the formal version looks like this:
P1: if P, then Q P2: P ∴ C: Q
you give it a conditional, you confirm the first part (the antecedent), and the conclusion has no choice but to be valid.
but... there's an evil twin. there's a move that looks exactly like modus ponens but is actually invalid.
if it's raining, the ground is wet (ok so far) the ground is wet. ∴ it's raining. (not quite!)
this is called affirming the consequent. the ground doesn't have to be wet from just rain. maybe someone left a sprinkler on or a pipe burst. you confirmed Q, but that doesn't mean P caused it.
modus ponens goes: if P then Q / P / therefore Q ✓ affirming the consequent goes: if P then Q / Q / therefore P ✗
it's fun (but also not so fun) to recognize how we affirm the consequent often in real life. "if he liked me, he'd text back. he texted back. he likes me." maybe! or maybe he's polite and putting up with your double texts. confirming the result doesn't prove the cause.
once you see the structure, you can't unsee it. modus ponens really is everywhere... just be aware when your brain is running the valid version or its evil twin.








