Possible Duplicate:
Should SO allow “give me some feedback” questions?

Would a "Hey look over this code and tell me if it smells" sanity-check for working code be an appropriate use for the site?


5 Answers 5


I don't mind these questions now and then, but in aggregate they become like being nibbled to death by ducks. If the site were to be flooded with them, I'd probably snap and punch TheTXI's favorite pony. Here are some tips I think will help keep the quality up:

  • Don't include a huge block of code. The more you can narrow down your area of concern, the better. We can always ask for more context if we need it.
  • Know what sort of issues you're concerned about. Don't just drop a code snippet on us and ask how to make it better. Demonstrate that you've given the code some thought, be it changes you've considered and ruled out or concerns you have.
  • Some of the best of these questions are the ones that ask how to better embrace the programming language to make this code better. For example, how to make the code more Pythonic, or how to DRY the code.
  • I mention this above, but it bears repeating: demonstrate that you've given the code some thought. Showing that you've tried goes a long way.
  • "I'd probably snap and punch TheTXI's favorite pony." - I love pony jokes.
    – jjnguy
    Jul 27, 2009 at 16:26
  • Be careful: you could hurt your hand like that. Better to use a cattleprod. Jul 27, 2009 at 18:26
  • A cattleprod is for cattle. This isn't quantum physics, Joel. Jul 27, 2009 at 18:28

If used in moderation, perhaps. There are already some questions like this that show up from time to time, and I often see them with a few downvotes, either because they are formatted terribly and hard to read or because some come across as "do my homework for me".

I certainly wouldn't want SO to devolve into some kind of code-review site, but the occasional "optimize/refine/improve my code plz" question is tolerable.


I think the question would need a fairly well defined topic. The questioner should probably point to a particular area of the code that he is concerned about.

But, if the surrounding code is included, answerers could examine the peripheral stench.


I believe the key is in how you phrase the question. First of all, you would need to do it with a limited segment of code, something that can be easily read and analyzed. Additionally, I wouldn't post any more than 1 or 2 a day, because you don't want to annoy people with constantly saying, "hey is this good", "now what about this?", "and this?"; you need to make sure you maintain respect for those attempting to help you out. And finally, as with all questions, it would need to be pointed at a specific topic or issue that is answerable. For instance, pointing out a specific part of the code your concerned might not be efficient, or readable, or may have a security hole and ask specifically about that. Basically, avoid saying "here's my code, tell me your thoughts", that's not really a question with a concrete answer in the spirit of SO.


I've done this on a few occasions, including breaking some of Pesto's rules, but I usually reserve it for patterns that I think might be more generally useful to others as well, and then ask for help improving that general pattern.

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