From the post,
Beginners post in the SO, and only beginners can answer in it.
The latter would be a mistake. Let the experts who are willing take the time to help answer it.
On StackOverflow, there is a bit of unwillingness to help beginners and sometimes even mockery. So, slide those over to people interested in helping and eliminate the rejection of questions for not matching StackOverflow's mission which are going to keep coming.
From the comments below:
I am a firm believer in always giving answers that solve questions in the best possible manor, rather than intentionally using a method that I know is not a good solution to the problem. This is especially true for newer programmers. Teaching them how to do things properly, from the start, is quite important. If you teach them techniques that are "simpler" but also undesirable then you're just building bad habits that will need to be un-learned later.
The point is as incorrect for professionals as non-professionals and thus represents a problem with StackOverflow as a whole.
First and foremost, the question must be answered as asked. Any failure to do so is discouraging, unhelpful, a waste of bandwidth and self-serving. Professional or non, they asked the question that way for a reason.
We must focus on this point. "[I]ntentionally using a method that I know is not a good solution to the problem." is not your concern. They may have a problem bounded by a constraint of a teacher, a compiler, a bug, 100 years of collective experience in another language, or a manager's refusal to use something different. If you can't help them with their problem, you shouldn't.
They may be working on a very large system where changes are required to be minimal. They may be choosing (or required) to do something the hard way to learn. It doesn't matter. They want to know. The particular question was partially skipping C++ array and pointers and going to
std::vector. This makes StackOverflow a proponent and contributor to the Java School problem -- while even staying in C++.
Second, add the better and best ways to solve the problem. This is what you want to do, but it must come after addressing the initial problem.
I support both "best possible" and "as asked." But, there is a dividing line between the two. The question I quoted was "closed as too localized... This question is unlikely to help any future visitors..."
That is why we need to differentiate between the two situations: StackOverflow gets, and will continue to get, questions where someone wants to learn or do something that you and I would see as "not a good solution" or that is a particular bug or issue not of interest to the general community. StackOverflow closes those issues.
But, those people need help, too, which is not the mission of StackOverflow.