5

I just failed this review audit. The question directly states they don't have a problem with their code, but want others to review what they've written for its intended purpose. I attempted to vote to close with a custom reason that code review questions belong on the Code Review Stack; but was then informed I had just failed it as an audit. I can deal with failing a review audit, but I seek clarity as to how that question is on topic here when it is essentially asking to check their work. My understanding is that questions asking to review working code are off-topic on Stack Overflow, especially since CR graduated into a full Stack.

Am I misinterpreting something and this question should be considered on-topic? Or was this a bad audit?

8
  • 5
    language-lawyer questions tend to have completely functional code (or code that works within a specific set of compilers) and is typically asking less about the code they wrote and more about if their interpretation conforms to the spec (or which compiler is more conformant). In this case the MCVE is small enough and abstract enough to look like a pretty standard language-lawyer question that tend to get a high approval rating in c++.
    – vandench
    May 31, 2022 at 18:03
  • 1
    @vandench Thanks for that. I had seen the tag language-lawyer pop up recently but wasn't quite sure what it meant. Now I understand, they are language-spec questions.
    – codewario
    May 31, 2022 at 18:10
  • 1
    @BendertheGreatest Yeah, in my ~40,000 CV Queue experience, usually anything tagged language-lawyer (especially if it is C, C++, or Haskell) is going to be a "Leave Open" decision... it does happen that an off-topic/close-worthy question appears, but it is exceedingly rare, at least in the review queue. Those tags by the nature of the languages tend to attract higher-quality Qs, and the communities do a fairly good job at weeding out bad content with votes. Good knowledge for the future :-)
    – TylerH
    May 31, 2022 at 18:26
  • In this case it got tagged language-lawyer in an edit, so it may have not shown up in the audit. That said, after seeing enough of those the first thing I did when I saw the question was check for a language-lawyer tag. You can usually spot them for their concise, well formatted code block, a couple of paragraphs usually with some inline code highlighting a specific language term, and typically a link to godbolt with multiple compilers open.
    – vandench
    May 31, 2022 at 18:46
  • Just as another data point, I have on one or two occasions added the language-lawyer tag to a Python question because it was asking about something sufficiently obscure (probably something involving metaclasses). Part of my intent was "please don't try to close this as unclear just because it doesn't appear that OP has a real purpose; this question can help improve theoretical understanding". Jun 1, 2022 at 2:43
  • @CodyGray Why do you assume that just because someone mentions there is another site on the network that it's the sole close reason? You know as well as I do we can only close a question with a single reason, despite how many problems it may or may not have. I chose to guide to that site because in its prior form, I felt it was asking for a code review, and felt it would be the most helpful reason to the asker. Code review questions themselves tend to lead to non-concrete and opinion-based answers as different users find different bits to hone in on. Different conclusions can also be reached
    – codewario
    Jun 1, 2022 at 12:10
  • You continue to assert that you voted to close the question because it was asking for a code review. If that wasn't motivated by the existence of the Code Review Stack Exchange site, then you badly misunderstand the scope of Stack Overflow. Asking questions about how to improve code is an OK thing to do here. Such questions should not be closed. Perhaps I was hyper-specific because I assumed you were falling into a common trap, rather than just making an invalid claim about Stack Overflow's scope. Jun 3, 2022 at 9:41

2 Answers 2

6

NB: I don't know C++

Yes, it looks like an incorrect interpretation of the question to me. As I read the question, OP has code that works in their specific scenario, but what they want is not a general review of the code quality, but rather a check for undefined behavior that would rear its head if they attempted to port the code to another environment/scenario.

Sussing out whether code results in undefined behavior per the specification is a specific, objective question and thus is on-topic here on Stack Overflow. This looks like a rather good audit compared to most... it requires thoroughly reading the question in full, whereas most bad audits can be discerned at a glance (in my experience). I did add an interrogative statement to the question since it was lacking that previously... hopefully that will help future reviewers.

And, don't feel bad, you are not the only person who has failed an audit on that one:

Screenshot of numerous audits, with at least one other failure

4
  • My own knowledge of C++ is limited myself, but the way it was worded, "The code runs fine, but I worry that this is not guaranteed", does not reflect explicitly asking whether it would result in undefined behavior (although answers to the question did indicate that it would). Your edit does address this, had a similar question been asked in the previous body I would have reviewed it differently.
    – codewario
    May 31, 2022 at 18:08
  • @BendertheGreatest I agree, it is a tricky one. In my opinion, the full context there ("What is unclear to me is whether the lifetime of the std::initializer_list will be long enough to support this use-case or if I will be experiencing the possibility of inconsistent memory access." right before the bit you quoted) indicates that OP is worried about UB in another machine or environment; they are asking for an authoritative spec reference re: UB on the code they are using. In another language that doesn't have the concept of 'undefined behavior', such a question would likely be POB.
    – TylerH
    May 31, 2022 at 18:13
  • It's not tricky at all. This audit is working exceptionally well. I'm quite pleased for a change. You don't need to dissect the wording on this one or have any knowledge of C++. There's no justification whatsoever for closing the question. Jun 1, 2022 at 8:12
  • 1
    @CodyGray the same question asked of CSS code would be unclear/POB, so I disagree. Your experience with C/C++ may be biasing your view a little.
    – TylerH
    Jun 1, 2022 at 17:26
0

Yes, this was wrong.

First, you should familiarize yourself with the guidance on migrating questions to Code Review. What was specifically incorrect is your misconception of closing this as belonging on Code Review.

What you should not do

Please do not vote to close with a custom reason that "it belongs on Code Review". Nothing in the Stack Overflow rules justifies such a custom reason, and sloppy reasoning perpetuates inappropriate referrals. Not all questions about analyzing code are off-topic on Stack Overflow, and not all code review requests are on-topic on Code Review. Instead, vote to close as too broad or primarily opinion-based.

With that out of the way...the question itself looks pretty much like a programming question. It's pretty clear and concise, and is looking for an explicit definition of whether or not the code they're running is ultimately defined behavior. So, this wouldn't be a question I'd recommend closing at all.

14
  • The explicit question asking whether the behavior was undefined was added a few minutes ago by TylerH. Prior to that, I didn't feel a clear question was being asked, other than "The code runs fine, but I worry that this is not guaranteed".
    – codewario
    May 31, 2022 at 18:11
  • 2
    @BendertheGreatest: Well if you don't think the question is clear, why would you want to suggest that it belong on a different site at all? Is this a case in which a skip of the review would've been better? (Also too you get this a lot in C/C++ in which - because there is the concept of undefined behavior - code can be written that produces that, either intentionally or unintentionally.)
    – Makoto
    May 31, 2022 at 18:14
  • 2
    I mean that I felt it was clearly asking about the integrity of their code, which on its own is asking for a code review. I didn't feel a clear question on topic for SO was being asked. As I mentioned before, TylerH's edit clears that up.
    – codewario
    May 31, 2022 at 18:17
  • 1
    This is the correct answer to the question, whether it's popular or not. The existence of the Code Review site affects nothing with respect to Stack Overflow's scope. "Is this specific piece of code valid and does it do what I think it does?" is a reasonable question for Stack Overflow, so long as "this specific piece of code" is, you know, specific enough (i.e., not too long and therefore not too broad to be answered in a Q&A format). TylerH's edit is not required to make the question clearly on-topic. What a fantastic audit! I don't say that often. Jun 1, 2022 at 8:15
  • @CodyGray There are meta answers here stating that we don't want code review questions. We've even burninated the code-review tag. You can't say there's no evidence that CR questions are definitively on topic here. There's no explicit rule and the community doesn't seem to want it. It's great it was clear to you how it's on topic but to someone who doesn't work often with CPP with the original wording it wasn't clear to me.
    – codewario
    Jun 1, 2022 at 11:45
  • Burn discussion, mentions in a few answers we don't want CR questions here. It's telling the tag remains gone today.
    – codewario
    Jun 1, 2022 at 11:52
  • @BendertheGreatest: Perhaps what I and Cody are enunciating is that we don't believe that this points to a specific review of code at all. Asking if something is undefined behavior sounds to me - personally - something that is at least an order of magnitude removed from "hey, can you review this code for correctness?" To be fair, questions on Stack Overflow will always have an element of code review to them, but this is a much narrower scope in which we would not be reviewing this code and where it's used as a whole, but rather just this piece of code or logic.
    – Makoto
    Jun 1, 2022 at 15:29
  • @Makoto My point is that it was unclear to me that the question was asking about undefined behavior until TylerH's edit. It also looks like that audit was problematic for a number of reviewers. The question is worded more concisely now to reflect to a non-expert what is being asked for; I think that should be considered a win.
    – codewario
    Jun 1, 2022 at 15:32
  • @BendertheGreatest: I can't see it as a win since you're implying that you didn't know how to review something in the review queues, but you did so anyway. This lets me think the thought, "What else did you review in this way?" Why didn't you elect to skip the review if you weren't certain of how to review it?
    – Makoto
    Jun 1, 2022 at 15:42
  • @Makoto "you didn't know how to review something in the review queues, but you did so anyway" Are you implying that reviewers should be robots? We're human. Humans make mistakes. My knowledge of C++ isn't zero and I thought I was knowledgeable enough to review that question. Obviously, I was incorrect and I conceded that possibility in my question itself. I don't exhibit a pattern of failing audits often, nor do I exhibit a pattern of asking about them.
    – codewario
    Jun 1, 2022 at 15:53
  • If this is the sort of hostile response I can expect to get when seeking advice on an incorrect action I took, or looking for personal growth in making sure I continue to improve during curation activities, I will just not seek advice on Meta anymore.
    – codewario
    Jun 1, 2022 at 15:54
  • My only issue with this answer is that it focuses on the wrong part of the issue. The issue is whether the qustion is off-topic, not whether it might belong on Code Review or not.
    – TylerH
    Jun 1, 2022 at 17:28
  • 1
    @Makoto It's unhelpful and somewhat unfriendly to say Bender "doesn't know how to review something". They reviewed it to the best of their knowledge/ability, and got it wrong. That's OK, and we should be lauding them for coming to Meta to better their understanding/reviewing knowledge, not shaming them for making a review action we disagree with.
    – TylerH
    Jun 1, 2022 at 17:29
  • 1
    The removal of a [code-review] tag does not mean that questions asking for a review of some specific piece of code are off-topic. It means that [code-review] is a "meta" tag that doesn't appropriately categorize content. And, yes, the cmnts here have been blunt. I'm troubled someone with >10k rep and who actively reviews Qs might think for a moment that this one should have been closed. Incorrect reviewing is more harmful than the lack of reviewing, and incorrect closure is almost equally as harmful as the lack of closure. (Perhaps more, if you consider how many more ppl it takes to fix it.) Jun 3, 2022 at 9:42

You must log in to answer this question.

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