Don't get me wrong, I'm one of the front-runners for wanting people to show what they've tried.
But I feel like showing what you've tried, all too often, turns the question into "What's wrong with my code?", as opposed to "How do I do this?".
Similarly with the answers - if asked what's wrong with code, often a partial code sample is given pointing out mistakes with corrections, or an explanation in words. (This does actually make sense at the time of providing said answer, as we don't really want to give users copyable code to their homework, and often the code is long and will just clutter the answers.)
Now every now and again I look for ... stuff (mostly to find a duplicate of a question) - often I just find the above on Stack Overflow - non-working code in the question and partial code samples or just explanations in the answers. Personally I'd much rather go looking for a reference that has a complete working program.
Not to mention that "What's wrong with my code?"-type questions don't make for particularly good references / duplicates, even if the answer is excellent, it can only do so much - it still has to answer the question, and the question with the non-working code is still on the same page.
So, some questions:
Is Stack Overflow going in the right direction with this approach?
(as many of these types of questions aren't particularly useful, as explained above)If we are not, are there viable alternatives?
If we are, can someone try to put my concerns to rest?
Would improving this perhaps just require some commitment from answerers to provide complete code samples? (What about the copyable code / clutter clauses above?)
Should "What I have tried" perhaps be a temporary thing - we encourage / enforce separating that part from the rest of your question / answer (where possible), and after some time, we edit these parts out of questions / answer?