3
$\begingroup$

Question #1 was flagged as ambiguous:

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.
— Community Bot

I made an assumption as to what the question was actually asking, and provided an answer.

Later, the question was updated and made less ambiguous, and my answer was flagged as no longer appropriate:

This answer is now unapplicable to the question, with the clarification added
— Seggan

So, I deleted my inappropriate answer.
Everything is as it should be now.


But then I posted Question #2, which asked the question that I had incorrectly assumed Question #1 had asked, and then self-answered it with my original answer.

However, Question #2 was then closed:

This question already has answers here: What are the advantages of providing an until loop construct?

The result is that my answer is inappropriate for #1, but the answer that it is appropriate for is considered the same as #1 and so can't be asked.

This seems amazingly like a Catch 22.

What am I missing here?

(Note that this isn't a complaint about anyone or anything. The questions and answers aren't especially significant, and the situation is more amusing than frustrating.)

$\endgroup$
0

3 Answers 3

2
$\begingroup$

As one of the close voters of Question #2, I'll explain my reasoning. From my point of view (correct me if I'm wrong), Question #1 is asking about the advantages of until (x) over while (!x). Your question is asking about the advantages of do ... until (x) over do ... while (!x). I think the answers to these questions will be very similar (if not the same), as they are asking similar things. The question is not a duplicate, but the answers would be.

I understand that your answer to Question #2 might not have been applicable to Question #1, but if Question #2 had been allowed to stay open, it would have just attracted some duplicate answers, which is not what we want right now. For this reason, I think it is correct that your question should stay closed.


But more generally, I would say try to edit it so it does answer the original question, but if that isn't possible, add it as a comment on the original question. I don't think there's anything else you can do about it.

$\endgroup$
1
  • 2
    $\begingroup$ If we have consensus about this being the case, I think the dup target should be generalized to actually make it an obvious dup-target. From the MSE FAQ: "If understanding why the questions are at all related requires a detailed explanation, the questions aren't duplicates, merely related." $\endgroup$
    – starball
    Commented May 22, 2023 at 5:29
0
$\begingroup$

I think your answer to the original question could be updated to match it properly.

Something like You can use until for different kinds of loops to disambiguate them from while loops

Paraphrasing a potential wording:

You can use until for different kinds of loops to disambiguate them from while loops

Having both until and while loops in the same language is a bit redundant. However, you could use until for do {} while (); loops to disambiguate them.

Consider:

while (condition) {
   ...
}

do {
  ...
  } until (condition)

The condition before the block decides whether to do what follows.
The condition after the block decides whether to stop doing what preceded.

Both feel natural, but having a while at the end of the block feels awkward.

Even worse, consider this (non-standard style) code:

       ...
   }
   while (condition)
   {
       ...

Which kind of while is that?
It's impossible to say from the immediate context.

For this reason, it makes sense to use until loops just so you have a different keyword for both kinds of loops. It is consistent too since both while and until mean "Jump if not" basically just in the opposite direction.

$\endgroup$
-2
$\begingroup$

If the questions are considered similar enough to be duplicates (a reasonable position ─ they aren't strictly the same question, but the answers will be mostly the same), a simple solution would be to just edit the one that remains open so that it covers both cases. Then the answers to the closed one can be migrated there. Including the wording from one question into the other would not substantially change the question's meaning, otherwise the questions wouldn't be duplicates.

Alternatively we can just not worry about it, and leave up the closed duplicate question along with its answers. It won't be automatically deleted.

$\endgroup$

You must log in to answer this question.

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