There is some confusion in this thread. Consider:
1. A QCD does not add the $5,000 to one's AGI, so it is not taxed. That is essentially a tax deduction. Yes, one must be 70.5 to do this and follow some other rules, too, BUT ….
2. Withdraw $5,000 from an IRA and use it to make a charitable contribution may also be deductible just as donating $5,000 from a checking account may be deductible. The difference between a QCD is subtle. First, one's AGI will go up which may affect tax credits and things like that. Second, for a donation like this to be deductible, one needs to itemize deductions on Schedule A which is really only worthwhile taxwise and useful if the sum of all deductions exceed the standard deduction. That is, the bar is lower for the case for a QCD.
3. Yes, if one has a taxable account, it is better to donate appreciated shares held long-term rather than cash if possible because then the long-term capital gains are not included in one's AGI. One get to deduct the fair market value of the donation as in #2.