17
\$\begingroup\$

I've started thinking about this more after seeing this question.

I'm sometimes tempted to vote such questions as not clear what you're asking, but I also feel that it's not quite needed for this site. This is different from SO, where it's just impossible to help if no request is given with the accompanying code. Here, on the other hand, there's just one main purpose: reviewing code. Of course, the OP could still have specific unspecified requests in mind. Whether or not that's the case, that's not crucial as long as there is code to review.

It could, however, be argued that having no explanation is possibly "another way" to have us review non-working code. Still, that cannot always be assumed in the event that the OP really wasn't aware of any detected issues. That's not what I assume, though. I'm just putting another point out there.

Then again, it could just be laziness... who knows.

Added: I found another example, one that seems "demanding" on top of lazy.

Both questions have something common, though: the code is just "thrown out there" for us to review. The only differences are the tones (if you consider that a factor). While we may still be able to review without context, how do you think visitors merely looking for answers will view them? Without context, it'll hardly benefit anyone but the OP. If it just benefits the OP, then it's of little value to the site (or any SE site).

What do you think?

\$\endgroup\$
2
  • \$\begingroup\$ From the title this question sounds like it is about questions that may provide context but doesn't mention "Please review all aspects." or asks "How can this be done in a faster?" or "Is this part clean?", but when reading this meta-question, it seems to be about questions that lack context. This is two different things and is a bit confusing. \$\endgroup\$ Commented Mar 30, 2015 at 19:26
  • \$\begingroup\$ That other example seems to have been removed. Now, if "we" could concoct a query giving good examples for questions bad for lack of a question… \$\endgroup\$
    – greybeard
    Commented Feb 2, 2016 at 16:59

4 Answers 4

13
\$\begingroup\$

As stated in the Help Center:

Reviewers may comment on any part of the code.

Feel free to call attention to specific areas you are concerned about (performance, formatting, etc). However, any aspect of the code posted is fair game for feedback and criticism.

I think it's pretty clear: whether or not you specify any particular areas of concern, any and all suggestions for improvement are fair game. The mere fact that it was posted on the Code Review site should be taken as a request for a code review, right? How would closing the question be helpful to anyone? Alternatively phrased, why should every question have to include the magic words "Please review my code in general" just to avoid being closed?

It's rare to find a piece of code that is so perfect that it cannot be improved. Whether the issue to focus on is correctness, robustness, performance, or clarity, let the wisdom of the crowd be heard!

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Good point. At first I think of it as "forcing a review on the OP anyway," especially if the OP has off-topic concerns but never stated them clearly. But then I remember that anything posted is fair game for anything (especially editing). If the OP never wanted a review and actually dislikes it, he/she can just choose not to accept an answer or something. \$\endgroup\$
    – Jamal
    Commented Oct 8, 2013 at 12:09
6
\$\begingroup\$

I think that some text describing what's requested should be required and questions that don't have it should be closed.

Without that text, there is no way to know what does the OP expect. For example, I have seen some questions basically saying “look at this nice code I have written”. Since they are not actually asking for review of the code, they should be closed as off topic. But without an explanation, it's impossible to differentiate these from actual code review requests.

\$\endgroup\$
2
  • 1
    \$\begingroup\$ That's a good point. I can't recall too many similar occurrences, but such questions would certainly be off-topic. I suppose I don't want to go straight to the close vote if the question isn't explicitly off-topic, but voting for good measure still wouldn't hurt. \$\endgroup\$
    – Jamal
    Commented Aug 2, 2013 at 17:04
  • 4
    \$\begingroup\$ @Jamal I don't see a close vote as something final, so I would comment and vote to close. If the OP clarifies it (even if it's just a comment), I would retract the close vote or vote to reopen. \$\endgroup\$
    – svick
    Commented Aug 2, 2013 at 18:56
5
\$\begingroup\$

I think that if the question doesn't have appropriate context about the code written then that should be voted to be placed on hold till appropriate context is given. Without proper context it wouldn't be useful to anyone other than the OP.

But in case context is given or it isn't needed (like in case of a very simple code or a standard algorithm) then I think we can take it as a general review request even if no specifics are mentioned. Obviously the reviewer can ask the OP about specifics before reviewing.

Like in this question no context about code's functionality was given initially but it was possible to review it without that. As needed context can be asked. Obviously if the context is given it would be easier but in simple codes it might not be needed. A proper heading and a few lines might be enough.

If the reviewer thinks there isn't enough context then a comment can be made and as @svick specified vote for close such a question and retract it/vote to reopen if the OP clarifies.

In short, context is good but depending on the question it might not be needed. If it is needed but isn't given we can do as svick said in his comment.

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

I think a brief description of the code is required just to be able to review it. Part of the review process is understanding what the code is supposed to do. As I understand it, the priority for a code review is to to find logic flaws; everything else is secondary. That's an extremely difficult thing to do with no back ground information. They should be downvoted and closed as "Unclear What You're Asking".

We're here giving (and receiving) a free service. It's the OP's responsibility to write a good question.

\$\endgroup\$
3
  • 3
    \$\begingroup\$ I partially agree and partially disagree. If no context is given and it's not very clear what the code is trying to do, downvote and vote to close as "Unclear what you're asking," I suppose. However, if you can look at the code and infer what the code is doing pretty easily, then I suggest editing the question to provide a code synopsis. \$\endgroup\$
    – nhgrif
    Commented Aug 11, 2014 at 23:05
  • \$\begingroup\$ It's a good thought @nhgrif, but at that point we're interpreting what the code is supposed to do based off what it does. I think that's counter productive to the whole "Does this code work as intended?" thing. \$\endgroup\$
    – RubberDuck
    Commented Aug 12, 2014 at 0:10
  • 3
    \$\begingroup\$ Sometimes the code is more than clear enough. FizzBuzz, for example. Other times, the code may be commented to the point of complete explanation (a huge comment block at the top of the code, for example), the user simply didn't duplicate the comment block in the non-code part of the question. \$\endgroup\$
    – nhgrif
    Commented Aug 12, 2014 at 0:12

You must log in to answer this question.

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