The anti-if campaign
antiifcampaign.com
antiifcampaign.com
It means that you can never trace control-flow. You see a function call you don't know where it goes. And all the underlying logic is hidden. There's no telling how many files you'll have to dig through to find the callee.
It also means there's no locality. When you have an if statement, the condition, action and alternative are all right next to eachother. With virtual functions, there in at least three different files. By the time you find one, you've forgotten the others.
Finally, it bulks code horribly with boilerplate. You can see that just with the examples on the site. This means less working code fits in an editor window, which means more bugs.
Anyone who believes this should try maintaining some low-if code of reasonable age. That will cure them quickly.
Should you make that gigantic switch statement be polymorphic? Definitely. Should you replace repeated if statements with polymorphism? Probably.
Locality of reference is a good thing, but there is a point where you need to break things down in to smaller, more understandable chunks. And if statements are no different.
A related principle is that a function's argument list should never be longer than its body.
As soon as you extract a method, or turn a switch statement into classes with polymorphism, or introduce a MVC pattern, you hurt locality, and that kills readability, like an essay with dozens of footnotes.
All those things have their advantages, but people are too quick to sacrifice locality.
If anybody can explain why ifs are supposed to be so horrible, then perhaps I might change my mind.
Simply? I'd say that creating a new class is a hell of a lot more work than creating a new elseif branch.
Of course, if their language don't have algebraic datatypes, I strongly suggest they learn one that have it.
Anyway, pattern matching + static typing is much more convenient.
Another problem is that if you only read the front page it only says if statements are bad. If you are a beginning programmer it probably sounds like nonsense if you don't get a reason.
Not 'less' ifs, people, 'fewer' ifs! </grammarnazi>
Punctuation was made for the reader, not the reader for punctuation.
Keeping the swastika.