9
\$\begingroup\$

The question has been put on hold with the reason code not implemented or not working as intended.

It is a curious case: in fact, the code is implemented, and does work as intended. The OP just didn't realize that.

Unfortunately the people voting to close also didn't recognize it. They were mislead by the OP statement.

It seems to be a manifestation of the larger problem, namely the vagueness of to the best of the author's knowledge clause. When an author admits the problem we are happy to close (and downvote) the question; when the author does not, we keep going even if the bugs are gaping, and the code couldn't possibly work (see e.g. this question). In fact, we punish honesty.

I strongly suggest to remove, or at least rephrase that clause.

\$\endgroup\$
  • \$\begingroup\$ I've taken the liberty to reopen this question \$\endgroup\$ – Vogel612 Mar 24 at 19:37
  • \$\begingroup\$ @Vogel612 Really... \$\endgroup\$ – Peilonrayz Mar 24 at 19:37
  • 1
    \$\begingroup\$ @Peilonrayz the code works. OP wants a review. Just because they didn't realize, that doesn't make the code any less working \$\endgroup\$ – Vogel612 Mar 24 at 19:40
  • \$\begingroup\$ @Vogel612 That's your opinion, clearly others disagree. What's up with mods and hammering grey questions. \$\endgroup\$ – Peilonrayz Mar 24 at 19:40
  • 4
    \$\begingroup\$ They don't want a review. They want an explanation of why their code doesn't do what they expect. The fact that the problem is the expectation rather than the code doesn't change the fact that they want help understanding the code. \$\endgroup\$ – Peter Taylor Mar 25 at 9:57
  • \$\begingroup\$ @PeterTaylor While true that they might not primarily be looking for a review, that rarely stops us from giving them one anyway (as has been done in the current answer). I would say that there are two things here: 1) They want an explanation for why the code doesn't give the correct answer for a specific input. I believe they understand the code, but not the math. 2) The code does do what they expect, the problem lies in the input value of the user. \$\endgroup\$ – Simon Forsberg Mar 28 at 20:01
10
\$\begingroup\$

Onto the core of your question:

It seems to be a manifestation of the larger problem, namely the vagueness of to the best of the author's knowledge clause. When an author admits the problem we are happy to close (and downvote) the question; when the author does not, we keep going even if the bugs are gaping, and the code couldn't possibly work (see e.g. this question). In fact, we punish honesty.

  1. Historically myself and others have posted similar answers to your answer on the second link. And we came to the consensus that you should probably post the answer as a CW. As it's really just a comment with formatting, not an answer.

  2. In regards to the second link. As I've highlighted before if you ask the question "can I run their code?" and the answer is "yes" then it's probably on-topic. This is as sometimes people have bugs in their code. Finding one doesn't make it off-topic.

    However this post should be off-topic as it doesn't work with basic input.

    People disagree here probably because it's hard to draw a line in the sand. Is one bug on/off-topic? Is a super hidden bug the same as testing with a, aa and aaa? If we say edge-cases are ok, what's classed as an edge? How do we know if they're genuinely a beginner that thinks they've written perfect code, or someone circumventing the rules?

    If you think it's off-topic VTC, and see if others agree with you. If it's not getting votes you can post a link in close room. Or post on meta like you've done now.

  3. As for the first link. Looking at what 'best to the authors knowledge' means we don't have to look far to see that it's off-topic.

    If your question contains something like:

    • ... runs ...but it gives the wrong answer...

    Looking at the pre-Vogel612 question and answer all I see is "My code is broken how do I fix it?" and an answer that says how to fix the broken code.

    This isn't asking for a code review.

\$\endgroup\$
4
\$\begingroup\$

I look at working correctly, to the best of the author's knowledge from the other direction. If the poster knows that the code is broken, or should know that the code is broken, it is off topic. By that I mean if some simple testing would show the code not behaving properly it is off topic as the poster has not tested the code. But if it is something like an edge case, that gets pointed out in the review (as edge cases are one of the things a code review should be looking for).

There is still a line between what's a "rare" edge case, and a more common problem that would be off topic, that is subject to individual judgement.

\$\endgroup\$

You must log in to answer this question.

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