6
\$\begingroup\$

I recently asked a question on StackOverflow and eventually ended up self answering it. The solution I came up with is, in my eyes, a bit of a hack.

Is a question asking for a different/better way of doing the same thing on topic here?

EDIT: This is the original question on stack overflow.

\$\endgroup\$
  • \$\begingroup\$ So you want your code to be improved right? And you think the solution you are using is bad, and would like a review of it? \$\endgroup\$ – Peilonrayz May 10 '16 at 11:35
  • \$\begingroup\$ @JoeWallis not necessarily the design, more a different way of doing it. I.e. don'y use foo use bar \$\endgroup\$ – TheLethalCoder May 10 '16 at 11:37
  • \$\begingroup\$ You may want to add the stack overflow question to this question. I'll also write a quick answer. \$\endgroup\$ – Peilonrayz May 10 '16 at 11:44
  • \$\begingroup\$ @JoeWallis I usually don't do that as some people complain about trying to draw attention to it but shall do \$\endgroup\$ – TheLethalCoder May 10 '16 at 11:46
5
\$\begingroup\$

Yes, but...

Code Review is indeed a site for doing the same thing in a better way, however... The code you are showing should not be "examplish" if you post it here. I noticed in your Stack Overflow question you had SomeMethod();, this could make your question be close at Code Review because of being "example or hypothetical code".

In your Stack Overflow question you also had a very specific question: Does anyone know why the code is slower when I comment out the calls to Console.WriteLine?

While good Code Review questions are often of the form:

  • How can I make this code faster?
  • How can I make this code more readable?
  • How is this code? Is it good? Is it bad? What can I improve?
  • Is there a way to avoid all these nested if statements?
\$\endgroup\$
  • \$\begingroup\$ The code that is necessary for the answer is however the ThreadingPriority stuff and the problem, as far as I can tell, is not always reproducible on different machines. Therefore wouldn't it be okay with just the relevant pieces and pseudo code? Also would the question Is there an alternative to setting the Threading Priority? be acceptable? \$\endgroup\$ – TheLethalCoder May 10 '16 at 12:15
  • \$\begingroup\$ @TheLethalCoder Avoid pseudo code. You don't need to include all the code to make everything compile, but you shouldn't change your method names and variable names etc. when you prepare your Code Review question. About if the question is acceptible, it might be - it is hard to say beforehand. \$\endgroup\$ – Simon Forsberg May 10 '16 at 14:58
  • \$\begingroup\$ Okay I'll probably avoid it because I doubt it'll be on topic but thanks for the help anyway. \$\endgroup\$ – TheLethalCoder May 10 '16 at 15:21

You must log in to answer this question.

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