5

I came across once-only lisp macro, yet another implementation today, in which the OP is following up on a previous question whereby OP had improved some code, presumably fixing it.

I tried implementing my own macro for the same purpose earlier, but it had a bug, as pointed out at once-only lisp macro, is my implementation correct?.

In this latest question, OP has presented a new version:

This time I have done another alternate implementation, hopefully fixing that bug. I would like to know if my implementation is correct this time around ?

I commented (and at least one person seemed to agree) that if there are no apparent problems with it (i.e., it seems to work, since OP isn't asking about a specific problem), then it might be a better fit for Code Review. I flagged for migration, but got declined with the reason that

declined — it's not clear that the code is working

screenshot of flag decline message

Now, I'm OK with that verdict, it's true that it's not necessarily clear that the code is working, but without any specific bug mentioned (and I'm presuming that OP wasn't intending to ask "there are X bugs in here, can you spot them?"), isn't this essentially a request for a code review of presumably working code?

If it's not, then it's clearly too broad, as there could be lots of bugs, and thus lots of possible answers.

What would have been the appropriate action here?

Update

In the comments on Jamal's answer, gnat pointed out a six point checklist for Code Review (from the On-Topic guidelines for Code Review):

Simply ask yourself the following questions. To be on-topic the answer must be "yes" to all questions:

  • Is code included directly in my question? (See Make sure you include your code in your question below.)
  • Am I an owner or maintainer of the code?
  • Is it actual code from a project rather than pseudo-code or example code?
  • Do I want the code to be good code? (i.e. not code-golfing, obfuscation, or similar)
  • To the best of my knowledge, does the code work?
  • Do I want feedback about any or all facets of the code?

If you answered "yes" to all the above questions, your question is on-topic for Code Review…

I think that OP would have answered yes to all six points, but the discussion seems to be hinging on whether the fifth ("To the best of my knowledge, does the code work?") is actually the case or not.

2
  • 2
    It should stay. CR is for working program looking for improvement.
    – nhahtdh
    Commented Nov 5, 2014 at 3:23
  • @nhahtdh I can understand the perspective that it shouldn't migrate. But if it shouldn't migrate, it seems like it should be closed as too broad, or unclear what you're asking, etc., shouldn't it? Commented Nov 5, 2014 at 3:25

3 Answers 3

13

I agree with the decline.

First of all, moderators are not required to have domain knowledge. In other words, they cannot be relied upon to check if code really does work or not. You were basically telling the moderators that you think it works, and that's it. The code could still have some obvious problems, so if it were migrated to CR, it may have ended up getting closed. The moderators would rather not take a chance on that (unless they had decided to talk to us CR mods first).

Here's my advice: if you think the OP's code works, make sure that he/she knows that it works as well. After that, make sure the code is fixed and the explanation is updated with a request on-topic for CR, then flag for migration. That way, even if some problems are still found, those fixes can still be included in reviews. We do not close questions if unanticipated bugs are encountered.

6
  • +1 because I can sympathize with the decline. I will take subtle issue with: "You were basically telling the moderators that you think it works, and that's it," though; I was telling the moderators that it appears that the OP thinks the code works. I may be mistaken what OP thinks, but a code dump asking "are there any bugs?" implies to me that OP thinks there aren't. (If OP knew there were bugs, then they would have been mentioned in the question.) Commented Nov 5, 2014 at 3:32
  • @JoshuaTaylor: They may still look at the question's title to tell for sure. When we view flags in the queue, we may not always load the entire question, especially if there a lot of flags to process.
    – Jamal
    Commented Nov 5, 2014 at 3:33
  • 7
    I would like to reinforce Jamal's answer here, but extend it to say: There's a difference between "My code works, can it be done better?", and "Does my code work?" In this specific OP question, they ask: "I would like to know if my implementation is correct this time around ?" This is not code that's ready for review... rather, it's code that's ready for some initial testing.
    – rolfl
    Commented Nov 5, 2014 at 4:46
  • 2
    consider quoting six-yes CR checklist. I think the more SO users are aware of this great check, the better chances are for migrations to go right
    – gnat
    Commented Nov 5, 2014 at 8:07
  • @JoshuaTaylor "Are there any bugs?" is not the same as saying "There are not any bugs as far as I can see". Saying "Are there any bugs?" means that you haven't tested your code enough. Commented Nov 6, 2014 at 21:01
  • @gnat According to the checklist, depending on what OP thought about the next-to-last point, "to the best of my knowledge, does the code work", the question would be a good candidate for migration. I think what this comes down to is whether "hey guys, I wrote a version earlier and we worked on that. Here's the new version!" implies "I think this one's working!" or not. Commented Nov 6, 2014 at 21:07
1

I do not believe so. Code Review is for completed, working code. They do not allow broken code there. On the other hand, code with bugs, is Stack Overflow's domain. It is a concept in programming, and fits the scope of this community.

1

I'm a bit late to this question, but the major flaw with the post you link to is that the OP doesn't describe what bug he's asking about in the post (you have to go to the linked post to figure out what the bug is). If the post explained that, it would definitely be on topic here (but not on Code Review IMHO, since the OP's asking about a specific bug).

In general, though, it seems like in most cases "does this contain any bugs?" and "is this implementation correct?" are variants of "gimme teh codez" (or, in this case, "gimme teh test casez"). It's the OP's job to test their code, not to just dump it on us and expect us to test it for them.

The particular post you describe is redeemable because it asks whether the code contains a specific bug, but more general "does this code contain any bugs?" questions should just be closed.

You must log in to answer this question.

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