5

I've recently asked a question. And it immediately started to get downvotes without any comment explaining what is wrong with it? If there is something wrong, I want to correct it and learn from my mistakes.

2
  • 6
    First thing that jumps out: the question is tagged C#, yet you show Java-like indentation and the function keyword which is not in C#. Also, the question doesn't show any research effort, I think I can whip up a couple of potential duplicates with one Google query. Then you ask "Is there a performance difference between these two?", which is generally frowned upon, see also Which is faster?.
    – CodeCaster
    Jul 26, 2016 at 11:19
  • @CodeCaster Thanks for pointing out wrongly using function keyword, whereas I could not find a duplicate. Jul 26, 2016 at 11:26

1 Answer 1

9

General rule is to read intently SO help section about scope of the questions and recommendations of how to create them. It's all written down long ago and most active contributors have read that many times.

Direct links:

(although I would recommend to read the whole help section, you will feel much more confident after that)

So, quoting from there,

if your question generally covers…

  • a specific programming problem, or
  • a software algorithm, or
  • software tools commonly used by programmers; and is
  • a practical, answerable problem that is unique to software development

… then you’re in the right place to ask your question!

Your question can only possibly belong to the first category, but in this case it's not really clear what is your specific programming problem.

Questions without a clear problem statement are not useful to other readers

and:

You should only ask practical, answerable questions based on actual problems that you face.

You're asking about performance differences (why do you need to know that?), but after intently reading the question, I would say you really want to know how to correctly expose async methods into sync code. Is there a safe way to do it?

describe the problem and what has been done so far to solve it

I would say you've got sync code and async code in your app. Some code is shared between them. So you found two ways of combining async code and sync code and now you're trying to find a difference between them to decide which should be used. (consider how much I had to assume and infer that you haven't stated clearly in your question)

Now this is:

  1. A rather general question about combining sync and async code in C#
  2. Question that already has answers e.g. here: How to safely mix sync and async code? (note how the person who asked clearly stated his specific problem and indicated that he has done some research into the topic)

You must log in to answer this question.

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