11
\$\begingroup\$

Does the feedback for a Code Review question have to be limited to the scope of the explicit code cited, or can we infer direction and context and comment on that also?

For example, in this answer, I attempt to dig a little deeper than just the code on screen. Is this appropriate? I kinda think it is, especially since the code in question is security related and us devs seem to get a bad wrap for screwing this kinda thing up.

\$\endgroup\$

2 Answers 2

21
\$\begingroup\$

No.

While alternative implementations without reviewing the code are usually unacceptable, going 'beyond' the code is certainly all-right.

Let's give some examples.

In questions, people often tend to write their cryptography. That's a bad idea. So it's certainly allowed to point it out.

Other times, people are re-inventing the wheel without doing so on purpose. Teaching them it has already been done can be very valuable.

At the end of the day, people write questions here to learn something by having their code reviewed. Review and teach, even if the teaching goes beyond the reviewing.

\$\endgroup\$
1
  • \$\begingroup\$ "re-inventing the wheel without doing so on purpose" - not to be confused with actually doing so on purpose (projecteuler.net). \$\endgroup\$ Jul 14, 2016 at 14:04
6
\$\begingroup\$

No.
@Mast gave a good example, and his last paragraph is quite correct, I'm just extending the concept a little bit.

In a professional software engineering environment code reviews will quite often be preceded by design reviews, in this environment only code should be reviewed for defects in a code review. Here on Code Review there is no guarantee that the design has ever been reviewed and therefore the intent and the direction of the code can be reviewed as well to help the OP.

\$\endgroup\$

You must log in to answer this question.

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