My question is: Are we helping people like this by providing the answer, or should we attempt to teach them to think like a programmer by asking a series of questions, leading the original questioner to find the solution on his own?
That would be a valid dichotomy if you'd be sure that the answers or teachings you would be giving are totally complete and truthful, which might not always be so. Therefore, the answer is simple - try to answer a question with the best of your knowledge, and let them choose to either discard, mindlessly copy-paste, or do their own research and be critical of your answer. Same as with good and bad students, really.