My mother thaught me to never give money to homeless people.
They are usually homeless for a reason, most of the time, either due to mental problem, or due to being addicted to something (drug, alcool, gambling, etc)
In either case, I don't want to give them money, In the first case, they obviously can't manage this money well, and in the second case, I don't want them to spend this money in their addiction.
I will usually give them something, either a coffee at the nearest coffee shop. or if I come back from groceries, I can give them something I just bought. But I will never give them actual money.