Why every programmer must learn propositional logic?
Discover the simple answer to one of the most commonly asked questions by programmers.
Propositional logic is the very basis of learning the science of reasoning. It is based on these simple constructs called propositions — true or false declarative sentences.
A typical computer science undergrad program includes coverage of propositional logic (in its larger coverage of discrete mathematics). In my opinion, every programmer (obviously including self-taught ones too) must learn it.
But why is that so?
argues a programmer who thinks otherwise. If you think this way too, let me present you the rationale for why propositional logic is necessary for a programmer in this article.
The basis for discrete mathematics
Discrete mathematics is one of the core tenets of computer science. It's a branch of mathematics concerned with studying discrete structures, such as sets, functions, relations, graphs, and so on. It's hard to imagine a computer scientist today who has no clue of discrete mathematics.
And one of the fundamental concepts of discrete mathematics is propositional logic. Whether you want to formally work with sets, relations, or functions, it's imperative for you to understand propositional logic's notation and some frequently occurring terms in English that arise from it, e.g "iff" which means "if and only if."
Used in digital circuit design
For centuries, propositions were studied by people as a mere form of reasoning, used to obtain new truths of the world out of existing ones. But nobody really thought of doing arithmetic using propositions until the 18th century when George Boole finally discovered this.
He put forth the idea that propositions could be combined together much like any other algebraic system. Later this discovery was named Boolean algebra in honor of Boole who revolutionized the way people thought of propositions. Boolean algebra is simply an algebraic system of working with propositions — as algebraic equations.
Building on top of this, Claude Shannon, an American computer scientist, came up with a seriously revolutionizing discovery that digital circuits could be made by combining propositions together. Basically, he drew inspiration from Boolean algebra and brought that to circuit design.
Today, almost all digital hardware is built around logic gates and these gates directly implement operators from propositional logic. For example, here's the AND gate which directly implements the conjunction operator (::\land::):

So, naturally, to be able to understand how your computer's hardware works, which is again paramount knowledge for a programmer, you need to understand digital circuit design. That, in turn, demands you to know propositional logic.
The basis of other logics
Computer science includes many diverse extensions of logic. For example, Artificial Intelligence (AI) uses fuzzy logic. Similarly, databases rely on predicate logic. Program correctness leverages Hoare logic. And so on.
As a programmer, you might find yourself working in one of these systems. And when that's the case, you'll thank yourself for already having learned propositional logic (if you really did so).
No matter what branch of logic you're dealing with, they all have roots going back to propositional logic. You can't really understand fuzzy logic when you're not comfortable enough with propositional logic. Same for predicate and Hoare logic, and in general, for any kind of logic.
Used for formal software development
It's hard to convince programmers, especially the self-taught category, that they're not just limited to creating websites, command-line tools, or desktop applications.
Being a programmer can also mean that you're working in NASA on space-critical mission code, or in Airbus in developing low-level control software for the airplane's navigation, and so on. Most importantly, these are areas where bugs can be extremely costly!
For that reason, programs that execute in these critical environments need to be formally verified for correctness. You can't just run a test suite in the terminal and say that It works!
when you get a 10/10 on the test suite. Also, they need to be formally specified.
Drafting these formal specifications and carrying out the formal verifications borrows ideas from propositional logic.
Used in Boolean searches
Many search utilities in software rely on the three fundamental operators in propositional logic: negation (also known as "not"), disjunction (also known as "or"), and conjunction (also known as "and").
These operators allow you to conveniently form super complex search expressions. For instance, consider the advanced search functionality of Gmail. It implements Boolean search, and is therefore a direct application of propositional logic.
Consider the following screenshot taking from Gmail Help, on Refine searches in Gmail, that clearly showcases the usage of operators such as "OR" and "AND" in the search query:

Popular search engines like Google and Bing also implement Boolean search due to its simplicity and expressiveness in defining the filters of a search query.
The key to solving logical puzzles
As a programmer, what do you spend your leisure time in? Well, it might be Netflix, or vibe coding (the talk of the town), or maybe playing some sports. For some, it's reading books or listening to podcasts.
Did you know that solving logical puzzles is an equally great way to spend this leisure time. In fact, it's also food for the brain. Consider Raymond Smullyan's logical puzzles from his famous book What Is The Name of This Book? or Lewis Caroll's famous arguments; they are all worth checking out and trying to solve.
Speaking of which, you can't solve a logical puzzle if you don't know what on earth is propostional logic. Propositional logic gives you a structured system to attack logical puzzles and determine the solution(s) to them.