One ought not to encourage beggars, and yes, you are right, it is far better to donate to charities that address the causes of poverty rather than to him, a creature who is merely its symptom.
Mohsin Hamid (2007). “The Reluctant Fundamentalist”, p.40, Houghton Mifflin Harcourt