Hello! Today, let’s discuss a specific logical fallacy: Post hoc ergo propter hoc.
Saturday morning. I wake up, prepare a coffee ☕, and start scrolling on LinkedIn1. I see a post from someone praising the benefits of TDD:
Since I started practicing TDD, my days are much more pleasant. No more console.log(“HERE“) for debugging.
NOTE: I already explained my perspective on TDD here. Yet, this post isn’t about TDD—just the logical fallacy in the reasoning above.
This person experienced the following temporal sequence:
His logic was the following: “I don’t use log statements because I’m doing TDD”. This is a logical fallacy, and it has a name: Post hoc ergo propter hoc. In English, “after this, therefore because of this“. Put differently, when temporality is confused with causality.
Sure, B (using TDD) is before D (no more log statements). Yet, D is not directly caused by B; it is caused by C (writing tests).
Indeed, this person doesn’t have to write log statements anymore because he wrote tests, and most likely good ones. Of course, TDD can help some people not to forget about tests, but again, TDD in this scenario wasn’t the cause of why he stopped using log statements.
Regarding fallacies, we’re talking here about a causal fallacy, which means we’re making an incorrect conclusion about an event’s cause. Post hoc ergo propter hoc is a specific type of causal fallacy that happens because we’re biased by an event that happens before another.
Tomorrow, I could also invent a new methodology for writing tests and called it Holistic Inclusive Testing (HIT). And I could fall into the same argumentation trap and publish the following:
Have you seen this, folks? Before, I had log statements, and now, thanks to HIT, I don’t need them anymore!
That would be the exact same fallacy.
If we generalize post hoc ergo propter hoc, the pattern is the following:
A occurred, then B occurred. Therefore, A caused B.
Furthermore, when (B) is undesirable, this pattern is sometimes combined with the denying the antecedent fallacy, which means assuming the inverse holds: believing that avoiding (A) prevents (B).
Here’s an example where (B) is undesirable:
I got vaccinated (A) then I got sick (B).
Post hoc ergo propter hoc is about believing that I got sick because I was vaccinated.
Combining post hoc ergo propter hoc with the denying the antecedent fallacy is about believing that avoiding vaccination will prevent me from being sick.
In the realm of simplification, the temptation to attribute outcomes solely to a specific practice of methodology can be high. Yet, in technical discussions, we need to stay mindful of causal fallacies, be it when sharing content or making causal analysis.
The irony in this story? Now my coffee ☕ is cold…
💬 Have you ever experienced or witnessed the post hoc ergo propter hoc fallacy in action?
📚 Resources
More From the Reliability Category
Sources
Explore Further
Why am I doing that?