6
\$\begingroup\$

Related to Is a bad approach for a problem a good reason to close a question?, this question is about the opposite instead: Is solely suggesting another solution a bad answer? We've been over this already, partially, in the question Short answers and code-only answers, but I wish to point out one particular variant:

This answer to Finding Primes in Java.

The question uses a rather bad implementation of algorithm A. I suggest algorithm B, and (in the 5 minute edit period) have managed to make quite something of my answer: I have managed to include time complexity for the current solution and the proposed solution, I have added a fancy GIF (animated images are worth their weight in bandwidth/screen space) and, generally, my answer is well sourced.

But it doesn't review any of the code. It reviews the solution. It takes a short look at the asker's code, tosses it into a pit and comes up with its own solution. There is no such thing as a review. I have more answers like that:

Blackjack Strategy - trivializes asker's code, suggesting a different implementation.
Min of 3 numbers - doesn't notice the bug in the code by suggesting a different implementation. Takes the different implementation and tries to escalate it to a yet non-existing problem.

Yet when you look at the scores, those are my best answers! One would think that if they truly were bad answers, they'd be downvoted, surely? But they don't. And I think I know why: They're good answers. They are bad reviews, though.

That last statement warrants the following questions:

  • Is solely suggesting another solution a bad review?
  • Is a bad review a bad answer?
  • Are questions asking for other solutions bad questions, as they don't invite reviews?
\$\endgroup\$
3
\$\begingroup\$

I will answer this with our 6 magic questions, especially question no. 6:

Do I want feedback about any or all facets of the code?

To me what definitely belongs into "facets" of code is the approach to the problem. This includes algorithm choice, architectural structure, class naming and design and so on.

To cut things short:

  • Is solely suggesting another solution a bad review?
    NO, because the solution is part of a code review and small answers are okay! See Jack of All Trades, Master of None - Let's work together to offer ultimately better content, faster for details.
  • Is a bad review a bad answer?
    Yes, but what you describe is not a bad review.
  • Are questions asking for other solutions bad questions, as they don't invite reviews?
    Yes, because we are allowed to review all aspects of code. Whether that be a solution or indentation, is irrelevant. If the question asks specifically for feedback on one facet only, it's a bad question, because it doesn't want a review on all aspects.
\$\endgroup\$
  • \$\begingroup\$ Your answer is contradictory; those 6 questions say it's okay if you want feedback on 1 facet, and you answer that because you want feedback on 1 facet, it's not okay. \$\endgroup\$ – Pimgd Aug 4 '14 at 13:06
  • \$\begingroup\$ Additionally, could you expand your answer on why solely suggesting another solution is not a bad review? Do you consider reviewing the solution to be a facet of the code review? \$\endgroup\$ – Pimgd Aug 4 '14 at 13:31
  • \$\begingroup\$ @Pimgd concerning your first comment. Important is the only part. If your question restricts possible answers to a single field by design, your question is bad. Concerning your second comment. Yes I do consider reviewing the solution a facet of a code review. \$\endgroup\$ – Vogel612 Aug 4 '14 at 14:40
  • \$\begingroup\$ edited your answer to reflect the rationale - did I get it right? \$\endgroup\$ – Pimgd Aug 4 '14 at 14:45
  • \$\begingroup\$ @Pimgd that's not my actual rationale, but it comes close enough ;) \$\endgroup\$ – Vogel612 Aug 4 '14 at 14:46
  • \$\begingroup\$ You could add yours alongside it, makes for a doubly strong point \$\endgroup\$ – Pimgd Aug 4 '14 at 14:47

You must log in to answer this question.

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