5
\$\begingroup\$

I ran across this answer which gives no code review feedback only how to write unit tests. If there were some unit tests provided, then they would be fair game for a code review also. In this case it seems more like a tutorial on how to write unit tests rather than specific review feedback for the code provided.

Is this answer on-topic?

\$\endgroup\$
  • \$\begingroup\$ I'm asking because I left a comment on the answer and got some upvotes (in agreement) but some comments that disagreed. \$\endgroup\$ – JeffC May 9 at 19:04
  • 2
    \$\begingroup\$ Strange, you're the second SO person in two days that I've seen say "gives no code review feedback", but when I look I see code review feedback. \$\endgroup\$ – Peilonrayz May 10 at 2:46
  • \$\begingroup\$ @Peilonrayz What in the linked answer do you consider code review feedback? \$\endgroup\$ – JeffC May 10 at 3:01
  • 1
    \$\begingroup\$ The same as rolfl, and the very thing you don't think is a code review - "teaching OP how to unit test". \$\endgroup\$ – Peilonrayz May 10 at 3:04
  • \$\begingroup\$ @Peilonrayz Can you provide a link to a guide to code reviews or a definition or anything that lists teaching the code submitter how to unit test is a goal of code review? Again... I'm not saying it's not valuable but it's not a code review. \$\endgroup\$ – JeffC May 10 at 3:09
  • 1
    \$\begingroup\$ I'm getting Déjà vu I'm not having another argument over what the definition of "code review" is. I will supply you with an answer however. To me it falls under "Every answer must make at least one insightful observation about the code in the question." The fact you have said "I'm not saying it's not valuable" shows that it's an "insightful observation" to me too. \$\endgroup\$ – Peilonrayz May 10 at 3:15
12
\$\begingroup\$

The "on-topicness" for answers is not nearly as clear-cut as for questions (and even that has plenty of grey areas). The very first sentence, on its own, is enough to make it a valid code review: "First the good: your code provides a testable function."

Abusive answers, or answers which do nothing more than provide links, or an alternative solution without critiquing the OP code in any way, are about the only things in answers that can be "off-topic"....

anything else is dealt with by voting. If you don't like an answer, or it does not add value to the site, or the OP, then down-vote it, otherwise, if it is great, provides good insights, then up-vote it.

If enough people downvote an answer it sort of disappears in to obscurity anyway.

\$\endgroup\$
  • 3
    \$\begingroup\$ I agree with all of this. Additionally, when voting, we need to consider how useful the answer is (to asker and to other readers). The example that's linked from the question does seem to me to be pitched at the right level for an asker who probably isn't yet aware of what benefits unit-testing brings, and gives enough toehold into the topic to get started. \$\endgroup\$ – Toby Speight May 10 at 8:04
6
\$\begingroup\$

which gives no code review feedback only how to write unit tests

Oh? Please take another look at the result posted in that answer. It's pointing out failing edge-cases in a very constructive (although some might find it too succinct) manner. It's using the OP's approach to point out problems OP missed. That, is teaching done right. Identify the knowledge of your student and use it to further the knowledge on the specific problem.

It may not fit your style, but that answer is definitely a review. And not a shabby one either.

\$\endgroup\$

You must log in to answer this question.

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