I came across this question Convert "for loop" from Python to C++ that asked for a translation of a single line of code written in python into C++. To me, this question seems to be on-topic for Stack Overflow. While code translation questions are generally too broad, this is about a very specific snippet of code, and I feel it is narrowly scoped. The question did show a lack of research effort, and is a basic question. The question received two close votes, one for Needs Focus, and the other for Seeking recommendations for books, tools, software libraries, and more, indicating to me that the question would have been closed in short order. What specific reason would have been used for the third close vote is not clear to me. The "Seeking Recommendations" reason is also strange. The question also received a score of +1/-4. At this point the OP deleted the question.
I brought up this post in SOCVR, where there seemed to be some agreement that the question is indeed on-topic, while at least one member disagreed with that assessment. I would have liked to undelete the question but it was pointed out that such an undeletion could have a negative impact on the OP. I'm not clear on the exact reasons, but there were mentions of the post potentially being "downvoted to oblivion", leading to a question ban being placed on the OP. Whatever these reasons, it seemed unfair to subject the OP to any harm, and so I decided not to vote to undelete the question.
However, being downvoted and question banned are not a concern for me, and so as an experiment I decided to post an essentially identical question How can I convert this python for-loop using a range into C++? myself. Based on feedback in the comments, I added "using a range" to the question title to make it less generic, and more easily searchable. Also based on feedback, I added an English description of the line of python code: "As the loop iterates, i
takes on the values n-2
, n-3
, until 0
."
I've incorporated feedback from the comments, I've posted a self-answer that I think is useful, and articulated in comments why the question shouldn't be closed. Considering all of this, I expected the question to be left open. I'll admit that I also expected the fact that I'm a high reputation user unlike the OP of the previous question, would make a difference. Of course, inferring whether this disparity in reputation had any effect at all is not easy, if even possible.
However, my post has now been closed, with the reasons being Needs Focus, Not reproducible or caused by a Typo, and a third reason[1]. The "Not Reproducible or Typo" reason is particularly mystifying to me. My guess is that my question was closed due to it being either too basic, or lacking research effort, and the smorgasbord of close reasons indicates to me that users were grasping at any close reason they felt they could reasonably apply. To my understanding, neither of these, i.e. how basic the question is, or lack of research effort, are valid reasons to close a question, and the appropriate action is to actually down-vote the question.
[1] I can't actually figure out what the third close reason is now that the post is closed, though I suspect it's "Needs Focus", since that's what the close banner shows me. Can a moderator check and let me know? I'd like to add that information to this question.
So my question is two-fold
Is this question on-topic, and if so, what can be done about such questions not getting closed?
Or if this question is off-topic, what are the reasonable close reasons? I understand there may be more than one valid close-reason, but at least three different ones suggest that users themselves might be unclear about why, or even if, this question should be closed. Additional guidance either way would clarify things.
I can think of at least one valid reason why this question could be closed, and that's if it's a duplicate. In fact, one potential target was suggested in a comment. However, I don't find it to be an appropriate target for this question. Regardless of whether this question does turn out to be a duplicate, my question still stands, especially since no one actually voted to close for that reason.
For context, my opinions on this are based in part on discussions with members of SOCVR, as well as the following posts:
Is "How do I convert code from this language to this language" too broad?
"I have this in language X, implement/help in language Y" - how do I respond?
etc.
For comparison with my own post, and since the original post is deleted, here's the full text of the original question.
For this Python "for loop"
for i in range(n-2,-1,-1):
What is the equivalent in C++
In case my own question gets deleted again, here is the full text of my own question for those who can't see it.
Consider this Python
for
loop using arange
:for i in range(n-2, -1, -1):
As the loop iterates,
i
takes on the valuesn-2
,n-3
, until0
.What is the equivalent code in C++?
This question is copied almost verbatim from another deleted question.
for
loop is a C++for
loop", then the question lacks details what it actually asks about. Whether one CV's for more focus, more details or a [mcve] all express that the question is missing some information.