6
\$\begingroup\$

On other Stack Exchange/Stack Overflow sites, voting is used as a form of quality control. High quality questions get lots of votes and are seen by many, low quality questions get negative scores and are pushed away from answerers.

But what is the purpose on Code Review, where some of the point of the site is to improve lower quality code? Is it simply for the text around the code, which is usually very little?

Is this the case, or am I missing something?

\$\endgroup\$
1
  • 7
    \$\begingroup\$ You don't vote on the quality of the code, you vote on the quality of the question. \$\endgroup\$
    – Mast Mod
    Commented Mar 15, 2021 at 16:19

2 Answers 2

8
\$\begingroup\$

On other Stack Exchange/Stack Overflow sites, voting is used as a form of quality control. High quality questions get lots of votes and are seen by many, low quality questions get negative scores and are pushed away from answerers.

But what is the purpose on Code Review, where some of the point of the site is to improve lower quality code?

The same happens on Code Review. I'll give an extreme situation. Someone, I, like lemon meringue pie, however I don't know how to make a lemon meringue pie. I'd like to make one. I come onto Code Review and ask "please can I have a lemon meringue pie recipe?"

Moderators (elected and unelected) would then downvote my off-topic post to signal to other users a problem with my question.

Is it simply for the text around the code, which is usually very little?

Voting is used for much more than just text.

I commonly downvote off-topic and spam questions. I have also downvoted posts for being on-topic but 'bad'. If you hover over the vote buttons we can see some guidance, for example the downvote button says:

This question does not show any research effort; it is not clear or not useful.

Contrarily upvotes are to show a question is good, such as being on-topic and being a question I'd like to answer. The question can be well written and the problem the code solves are easily understood. The requirements of the code are also laid out and easy to understand. We can see what the on-hover for the upvote button says too:

This question shows research effort; it is useful and clear.

Is it simply for the text around the code, which is usually very little?

The text of a question can be one part of the question we vote on. But not the only part. Additionally only bad questions tend to have "very little" text. One could argue such questions are off-topic and would be worthy of downvotes and votes to close for lacking a description.


Not voting can be used if the question is neither bad enough for a downvote nor good enough for an upvote. The absence of votes can show a question is on-topic, but not a great question for lacking a description amongst other things.

Your only question on main I would rate as "could be off-topic but lets be lenient here, but the question lacks pretty much any description."

\$\endgroup\$
0
5
\$\begingroup\$

As you surmise, the quality of the description plays a large part in deciding how to vote on a question:

  • Is the requirement (problem statement) clear and concise, with appropriate mention of any unusual constraints?
  • Are there any examples showing how it's used?
  • Did the asker explain why this algorithm and language were chosen, and what other approaches were considered?

There are some aspects of the code that do affect the question quality, too:

  • Is it presented in a logical order, that makes it easy to understand? (When a program comprises multiple files, their ordering is a property of the question, not the code itself.)
  • Does it look finished and ready for review, or does it look like "the first thing that worked?"
  • Are the unit tests included, so I can experiment with making changes for myself?

For completeness, there are some aspects of question quality I try to directly improve (with edits and/or comments), and specifically don't use for voting:

  • Problems with use of English as the site language - when that's hard for people, I try to help clarify the writing. (As a near-monolingual Brit, I feel a responsibility that if I can't speak your language, I should at least help you speak mine!)
  • If the indentation is all over the place, and if I know (perhaps via comments or external link) that it's a problem with copying it into the question, rather than how the code itself was written, then I'll edit to fix that.
\$\endgroup\$

You must log in to answer this question.

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