Should I effectively encourage those questions by answering them?
Playing devil's advocate, I'd say "it depends."
Generally poor questions that show no effort or research, or one of those 'can I haz teh codez' questions, all which have been addressed in the great answers above, should definitely be flagged or at most commented on telling said asker to Google or read a duplicate question.
However, some low quality questions do have value. There has been a lot of times I have searched online for 'How to do in ?'. Most of the time I find my answer on SO as the first hit, or some obscure blog, or a duplicate of another question.
Here are a few reasons why to answer 'poor-quality' questions:
- No quick and easy reference can be found. It's buried in the docs.
- The question with an answer already is not easily found via search.
No quick and easy reference can be found
An example (that does not represent the entire issue, of course) is that one time I searched for 'How to run a python3 script' when learning about Python during a course. There were links to official documentation, entire posts explaining what happens when you run a python script, and in other cases when I search for answers online, it's common to find it buried in a lot of documentation. Answers on SO have been great as it provides the format for a quick and easy answer, followed by a more detailed explanation of it all. I feel that in cases like these we should answer the question, and provide a link to the docs, as well as gently nudging the asker to 'RTFM'. Many questions are answered by reading the docs or even the manual, but how many people actually do that when they can type a few words to search for it?
Question that already has an answer cannot be easily found
Perhaps the asker has already tried to search for an answer, and couldn't find one because the actual question did not have enough traffic to bump it up the search results, and relies on more specific keywords to get the question that has already been asked. I feel that questions like these should be answered, with a link to the duplicate, so that future site visitors can find what they're looking for quicker. After all many questions help point to a canonical answer, they definitely serve a purpose, especially for people new to a language or programming concept.
Another reason that the asker couldn't find an answer for it could be because they do not know the right keywords to search for the answer, it's hard to search for something when you don't know what you're searching for. They definitely know that something is wrong, and it can be solved, but they don't know what to search to find the answer they're looking for, so they ask a 'bad' question. That way the people more well-informed on SO can point them in the right direction.
To be clear, that does not mean that we should answer all 'bad' questions. I agree that questions that show no research effort, or tell me what's wrong with my code questions should not be answered, hence my approach when seeing bad questions and considering to answer them or not is to Google said question.
Can I find it on the first page, is it clear? Is it a complete duplicate, or a similar question? Did I need to add more keywords to get the answer?
If an answer is not found easily, or does not particularly fit the question, I answer the question, with a link to the question previously asked, as well as provide some direction on where to go from there ("read this, look at that, learn up about this"). I also try to add more information that adds value to the question, stuff that is related to the question, hopefully that way the person that asked the bad question leaves SO learning more about what they didn't even know about.
If it's a question that has an answer on Google or it's too short to give a proper answer, I just tell them in the comments and flag them or let the mods close the questions.