Lately I've been fascinated with the idea of logical fallacies, and especially problems in arguments that may at first glance seem reasonable.
Now, clearly not every argument is as tidy as in the mathematical world, where we can derive a swath of lemmas and theorems given a few axioms, and rules for moving from one step to the next. But I think most would agree that we would prefer our arguments to be firmly grounded in logic, to the extent possible.  So let's take a look at some common problems in reasoning, in the hopes that keeping them in mind (and attempting to avoid them) will allow our conversations to be more meaningful.
Correlation vs. causation
One of the most famous and easily identified fallacies is the mis-assignment of correlation vs. causation. It even has a fancy Latin name: post hoc ergo propter hoc (after this, therefore because of this). The big idea here is that even when two events happen together repeatably (correlation), that's not generally enough evidence to show that one caused the other. The association may belong in reverse, or there may be another event in play that causes them both, or it could just be coincidental.
- It rains when I get a carwash, so the carwash caused the rain.
- I yelled at the television and my team scored a touchdown, so I caused the touchdown.
- You checked in some code on our project today and my computer crashed, so you broke my computer.
I notice this particularly often in mainstream journalism about scientific studies. Often, the scientists themselves have been careful to either (a) not argue for causation where only correlation exists, or (b) ensure the process and data actually support causation, but it's hard to check that expectation given only a small blurb on the news about what the latest healthy or unhealthy food is, for instance.
In programming circles, the straw man fallacy seems to be a common one, both in actual use and in people recognizing it. A straw man involves setting up a weak or distorted version of an argument you're trying to invalidate, and easily knocking it down.
- You say my car is dirty. But I'm not going to go get a car wash every 3 days - that would be way too much!
- You want to use NoSQL database X on this project? We can't use every crazy fad datastore that pops up!
- Political party A proposes bill #1. Sounds like they want poor people to die in the streets, and that's wrong.
- Political party B proposes bill #2. Sounds like they want the government to control every aspect of people's lives, and that's wrong.
The interesting thing here is that in many cases, the logic following the setup ends up being flawless. The important question to me is: what is being argued against, and what are the premises? Very often, replacing straw man arguments with deep listening and conversation can lead to the discovery that there is actually more agreement than disagreement.
My personal most-encountered fallacy (and most-wrongly-used myself) is that of the false dichotomy, where the writer asserts or assumes that precisely one of two options may be chosen.
- You're either with me or you're against me.
- This piece of code is either good or it's bad.
- We can either write unit tests or think hard about our problem.
Certainly there are real-world cases where there are exactly two choices, and exactly one must be chosen, but often there may be a third option, or we may choose both options, or we may ignore the question entirely, etc.  Anytime we can correctly say "But those aren't mutually exclusive!", we're looking at a false dichotomy, and considering decisions beyond those suggested by the question might be reasonable.
Now, surely by this point you've taken issue with one or more of my examples, and perhaps you even know the name of what I may have implied here: the fallacy fallacy. The idea here is that when someone uses a logical fallacy in their argument, it makes their argument incorrect, but not necessarily their conclusion. So we must be careful not to dismiss an idea out of hand simply because an argument for it is flawed. It seems to me that disproving a conclusion takes significantly more work than finding flaws in an argument. Specifically, it means creating a new argument!
So, when we construct our arguments, whether for or against, let's take care to make our arguments as correct as possible, to strive to recognize and own up to problems when they occur.
 In both writing this article and being (quite!) fallible, I fully expect to make missteps, perhaps by falling into a logical fallacy myself. I hope you will grant me the benefit of the doubt and kindly let me know, at email@example.com.