16
\$\begingroup\$

I recently viewed a question where the only answer was simply telling the OP to use a provided API instead of scraping data themselves.

Is this considered an appropriate answer on Code Review? My initial reaction was that it is not. It isn't reviewing code that the OP posted; it's simply mentioning an alternative (although I'll admit, better) way of going about things entirely.

It's upvoted though, so maybe I'm in the wrong in my thinking?

Should I mentioned to the answerer that their answer should be a comment? Should I just leave it alone?

\$\endgroup\$
  • 4
    \$\begingroup\$ If you're talking about this answer, it was almost useless at first and nothing more than a vague "RTFM" link to a large amount of documentation. It got edited and improved afterwards. BTW, OP specifically wrote "Is there an easier way to do it?", so it should be allowed to propose a completely different answer. Shameless self promotion: that's why I wrote this answer, which isn't even using Python. \$\endgroup\$ – Eric Duminil Sep 17 at 7:55
  • \$\begingroup\$ @EricDuminil Yes, that's what prompted the question. \$\endgroup\$ – Carcigenicate Sep 17 at 13:08
27
\$\begingroup\$

I believe it is a valid code review .... sometimes perhaps even the best code review is: Why are you doing all this hard work, just use that ...

In specific cases where the user is intentionally doing the work, they should tag their question with .

On code review, I would typically ask in a comment something like: "Did you know there's an API for this here: ..." .... and let them decide, though.

\$\endgroup\$
  • 1
    \$\begingroup\$ Agreed. And even if someone is reinventing the wheel, a good answer about the code won't suffer from a 2-line reference to a good library. \$\endgroup\$ – Gloweye Sep 27 at 7:14

You must log in to answer this question.

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