Some questions boil down to "how can/do I do X?" Here's an example.

Sometimes, people leave comments under such questions that ask "what have you tried?" Is it OK to leave comments like that? Should all questions contain snippets of non-working code?

  • 142
    You're asking the wrong question. 'Is it okay to put minimal effort into asking and expect others to do the research and try for me and feed me the answer with on a silver platter?' Feb 21 '12 at 11:55
  • 36
    These days I also link to whathaveyoutried.com
    – Oded
    Apr 3 '12 at 12:38
  • 8
    Yeah, but some of the posters are newbies and really don't know where to even begin.
    – code4life
    Sep 28 '12 at 16:34
  • 13
    @code4life - And that's ok... but then they should list out searches they tried, thoughts they have, and what they're stumbling on. I'll leave a what have you tried if there is clearly no effort visible. If they say "I'm stuck, here's my research and thoughts and problems". Then I don't. Even that shows effort.
    – Mike
    Oct 2 '12 at 17:39
  • 12
    I hate the "What have you tried" comments. Mostly because it's a misnomer. I actually don't want to hear about your discarded attempts unless it's relevant enough for me to help you with the question Nov 2 '12 at 14:46
  • 2
    "Yeah, but some of the posters are newbies and really don't know where to even begin." My main problem is that newbies don't want to show their code. It takes sometimes a dozen comments to make them post the code they have so far, to be able to point out their mistake. I don't know exactly why beginners are so reluctant to provide the code that they try to make work. I understand that they are not too confident to share their code because they know they are beginners, but how can they expect support when they won't share what code doesn't do what they want it to do.
    – zoechi
    Jan 22 '17 at 14:01
  • Honestly, the hardest part on SO is to convince newbies to share their code. Once they did it it's usually a matter of seconds to provide an answer that points exactly out what they did wrong and what they need to change and why that change is necessary.
    – zoechi
    Jan 22 '17 at 14:02

It's perfectly OK to ask the OP to inform us of what they have attempted so far to solve their problem, in a polite, constructive way.

So many people were asking "What have you tried?" without any useful elaboration about what information would be helpful, that it was becoming rude. As of March 2013 that comment has been outright blocked.

See the message about the block for more constructive alternatives, and consider more specific comments addressing what's lacking in the question:

Please can you show the specific piece of code that's not working.

or even:

Please explain what you mean by "not working".

You should always be polite - remember the rule "be nice". We're trying to "make the Internet a better place" here. In this case it's better to be a little more verbose than you might want to be as it can help to explain just exactly what information you think is missing.

However, it should be pointed out that if you need to add any (or all) of these comments then that's the mark of a bad question. Leaving these comments is hopefully the first step on getting a good question that people can answer.

If there's no effort to improve the post then it's the mark of a question that can be closed.

  • 30
    You can also link to whathaveyoutried.com which gives an excellent explanation
    – jrturton
    Feb 21 '12 at 11:27
  • 1
    What about if OPs can't show a code because they really don't know how to solve their problem ?
    – Zul
    Feb 21 '12 at 11:34
  • 6
    @ZulkhaeryBasrul - in that case they may be asking on the wrong site. If it's a design question then [Programmers](programmers.stackexchange.com] or User Experience might be a better place to ask.
    – ChrisF Mod
    Feb 21 '12 at 11:36
  • 11
    @jrturton I love that post, but did you really expect someone who doesn't bother reading how to ask a question to read all that page? Feb 21 '12 at 13:07
  • 2
    @DamienPirsy hah! No, but the fact there is a whole website might hammer home the point that it's an important thing to us!
    – jrturton
    Feb 21 '12 at 13:11
  • 9
    IMHO, hurling witless slogans at people is just lazy, and a very poor substitute for communication. I have usually been flagging these comments, as I think that, at the very least, we should be able to outwit a bad NLP algorithm. Looks like I'm in the small minority on this question though.
    – McGarnagle
    May 10 '12 at 3:44
  • 3
    @dbaseman - I was implicitly assuming that the comments were polite and informative. I've updated the answer to make that explicit.
    – ChrisF Mod
    May 10 '12 at 9:41
  • 3
    It's not ok anymore: meta.stackexchange.com/questions/172758/… Mar 23 '13 at 21:36
  • 4
    @TimSchmelter - I think the key here is to be polite. Adding a link to Google, "WhatHaveYouTried.com" (or whatever it's called) is not polite which is the real problem.
    – ChrisF Mod
    Mar 23 '13 at 21:38
  • 18
    'What have you tried' isn't not polite. It wasn't impolite with every prior revision of this answer, so why now? The reason So many people were asking "What have you tried?" is because so many people are asking zero effort questions. This simple non-impolite phrase assists with increasing question quality and by extension, answer quality. By my understanding, that is how SO is trying to make the internet a better place, not by artificially bumping up an arbitrary politeness level. Following this, you should add a line in the good question FAQ: Remember to always say please. Yahoo!
    – mcalex
    Apr 6 '13 at 6:24
  • This seems like a topic not worth debating. You find "What have you tried" bad, but "Show your code" is fine? What if you don't care to see the code, and all you need is a quick summary? The two seem as if they could be interchangable. If people are asking confusing questions (most likely due to not taking the tour on how to ask/answer), why should anyone care how impolite "What have you tried" MIGHT be (are you sheltered? this is no where near impolite, ESPECIALLY for the internet)?
    – Dioxin
    Sep 9 '14 at 16:58

Well in my experience what have you tried? comments quite frequently seem to be a synonym of bad luck.


  • 44
    I think you mean a synonym of "bad question"
    – JNK
    Feb 21 '12 at 13:28
  • 4
    @JNK yeah pretty much so. To me, whathaveyoutried is kind of the last resort when I can't squeeze anything to find an answer or at least to figure that question may be answerable by someone else
    – gnat
    Feb 21 '12 at 13:34
  • 42
    To me it's the first thing I ask if the question is of the Plz send teh codez type
    – JNK
    Feb 21 '12 at 13:35
  • @JNK well I just re-checked "bad luck" questions shown at screen shot. Two of three are Plz send teh codez indeed :)
    – gnat
    Feb 21 '12 at 13:52

In my understanding, What have you tried or my default response (Please share your effort) does not only point to code.

Yes code is very important, but these comments mean have you put in any effort regarding the problem?

Note, effort can be in terms of:

  • Code implemented
  • Searching through any search engine or portal
  • Broke problem into smaller problem statements and solve them individually.

For example a very common problem statement,

List names and marks of Maths and English of all students who have scored more than 70%.

Now this may be complex problem for someone but if you break it like:

  • Get all students who have scored over 70%
  • Get necessary details of every student.

You have partial scope and you can try links on filtering list of objects and fetching values from an object. Now if you share link for both problems saying I have found this link for a and this link for b, but how to use them together, this shows you have tried something. Yes, there is a possibility that your search query was not good enough, but sharing this information will show users, your sincerity and they will not only help you with proper solution but also help you to improve your query.

Sharing efforts also tell user a lot about user who is asking and based on this, answer will be different. For a beginner, you will make answer more descriptive but for a well framed specific question, answer to that area will suffice.

Yes there are cases where you have no idea where to even start searching. For such cases, mentioning this in question will also help users as they know OP is a beginner and is not aware of terminology specific to technology and will frame answer accordingly.

So all in all, I believe its valid to ask for efforts, but as mentioned in community answer, you should use proper tone.


If the poster has asked how to do something without providing information about what they have tried, and you think they ought to, you must be thinking

  • It is unclear what the precise problem the poster has with the task, but providing that information would make it clearer
  • providing a complete answer to the problem would be too broad unless the poster narrows the scope by indicating what they have done already.

But those are valid close reasons. The question as it stands is off topic. Instead of adding a comment, vote to close the question,, and move on.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .