5
\$\begingroup\$

Yesterday I stumbled over 2 questions which seemed to be sample code.

The first stated

I wrote a sample project to show you my model. What do you think about it?

and the other had code like

public async Task TheMethod(int id, string val)  

and

// DO LONG RUNNING TASK
await Task.Delay(3000);
Console.WriteLine(id + " " + val + " at time " + DateTime.Now.ToString("m:ss"));  

Usually I would vote to close both of the questions.

For the first one I would have voted but I hadn't been entirely sure also because I already commented on the op's question on Stack Overflow.

I did vote to close the second one and it is on hold right now (also it seems to be running code but just looks like sample code).

Should we add a tag or should we decide from case to case if a question like these are on/off topic?

\$\endgroup\$

3 Answers 3

5
\$\begingroup\$

Speaking in general, without passing judgement on the two cited questions…

I'd say that a [proof-of-concept] tag wouldn't work well. Tagging is too black-and-white an act for such a nuanced decision. Furthermore, the distinction between proof-of-concept and hypothetical code is so thin, if it exists at all, that I would have a hard time explaining it.

Users who think that the question is off-topic should, of course, vote to close. I wish there were a counterbalancing vote to not-close feature available, but there isn't. I think that the next best thing would be to write a comment in defense of keeping the question open, and hope that others agree not to close it.

\$\endgroup\$
3
  • \$\begingroup\$ sounds fair to me \$\endgroup\$
    – Heslacher
    Feb 12, 2015 at 7:12
  • \$\begingroup\$ The only way to vote to not-close is to vote "Leave open" in the Close review queue. \$\endgroup\$ Feb 12, 2015 at 10:40
  • \$\begingroup\$ Everyone who has viewed the question and not voted to close has voted to not-close... \$\endgroup\$
    – nhgrif
    Feb 16, 2015 at 23:47
4
\$\begingroup\$

I have reopened Code snippet for a method dealing with IDs from multiple threads. I agree with @Heslacher's observation that, despite the fact that the code is packaged in a function called TheMethod(), and the presence of a await Task.Delay(3000); // DO LONG RUNNING TASK placeholder, this code solves a concrete problem, and is far from a general / hypothetical best-practices question.

I'd like to point out that the author of the code is probably having difficulty putting a name on the problem that the code solves. Suggestions for naming is one of the topics that could be covered in an answer.

\$\endgroup\$
3
\$\begingroup\$

With Java MVC model for large scale GUI using annotations, I initially closed it, then reopened it at @Vogel612's request.

On closer examination, I agreed with @Vogel612's reasoning. The question about annotation support is centered around the View.ButtonAction.actionPerformed() method. Most of the other code was just supporting material to demonstrate how to take advantage of that annotation mechanism.

For a while, I was going to ask the author to revise the question to better distinguish the core from the example code, but considering that it was a new user who had already made a decent effort to ask a good question, and that @Vogel612 had already posted an answer, I decided that being so fussy wasn't worth it.

\$\endgroup\$

You must log in to answer this question.

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