25

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:


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 a range:

for i in range(n-2, -1, -1):

As the loop iterates, i takes on the values n-2, n-3, until 0.

What is the equivalent code in C++?


This question is copied almost verbatim from another deleted question.

29
  • 17
    OK, the question wasn't closed. The "Needs Focus" CV is also on point - it's pretty valid for "write this code for me" questions like this one. The "seeking recommendation" CV is weird but I suppose it's the same spirit. Ultimately, the question is bad - no research, no effort, and a work request. The fact that it's easy doesn't really make it better, kind of worse.
    – VLAZ
    Commented Nov 24, 2020 at 19:52
  • 17
    @cigien strictly, yes I would support closing such questions but, since they are from 09, they have historical support and importance, so I would not go out of my way to close. Today, asking an SO question about a basic loop construct is indefensible in any language. Commented Nov 24, 2020 at 23:02
  • 5
    It is a misunderstanding to close a post as too basic or lack of effort. The post should not have closed at all. I suspect it's a bit like drift.. users drift into thinking it's all good to close such post, instead of re-reading the help center.
    – Scratte
    Commented Nov 24, 2020 at 23:04
  • 5
    @cigien if the new language is so undocumented by its designers, you should not use it. Commented Nov 24, 2020 at 23:08
  • 24
    Personally, i have never thought of Stackoverflow as a replacement to documentation or basic research and understanding. People put their time into this place, not to help individual users, but to help future users (like our selves). If we encourage the most trivial questions we turn from a knowledge base into a homework site, and first responders to the millions of students who didn't listen in class, which in turn will dilute the talent that this site has traditionally drawn as answerers (IMO)
    – TheGeneral
    Commented Nov 24, 2020 at 23:09
  • 7
    @MartinJames That's a reasonable opinion for you to have, but that doesn't address the issue. Is SO going to stop accepting questions that don't have good documentation? Not to mention that SO answers are consistently higher quality than the documentation for most languages.
    – cigien
    Commented Nov 24, 2020 at 23:16
  • 7
    There are multiple possible equivalent realizations that are valid in C++. Asking for "the equivalent code in C++" makes it opinion based. Asking for all possible equivalent realizations is overly broad. Your answer is one (or 2) possible realizations and I doubt the first is typical or prevalent of range-based for loops currently extant in C++. Since you've already received a comment that its a matter of taste, and you agree completely, there seems little doubt that the answer is a matter of opinion. [Comment moved from main –mod] Commented Nov 25, 2020 at 0:11
  • 20
    Code translation questions are almost always useless. They tell us that you don't know either of the two languages. It means we would have to explain and teach you both of the languages at the same time. They are too localized and too broad at the same time.
    – Dharman Mod
    Commented Nov 25, 2020 at 10:43
  • 6
    @TheGeneral "If we encourage the most trivial questions..." It's not a close reason anymore. It used to be (lacks minimal understanding) but it could be abused too easily, so it was abolished. Just selecting another close reason that doesn't apply to circumvent this is problematic. Downvoting does the job of discouraging most trivial question quite fine. What more do we want/need? Commented Nov 25, 2020 at 13:14
  • 8
    The answers to this question have been eye-opening to me in the sense that they have exposed the, apparently, vast swath of veteran curators that go out of their way to close questions that should possibly be downvoted but do not have a clear close reason. I'm kinda floored.
    – zcoop98
    Commented Nov 25, 2020 at 23:00
  • 9
    @Alexei I have never recommended waiting to close. I would never recommend this. Always vote to close immediately if the question is unclear. In this case, though, the question isn't unclear. Everyone just voted to close it because they think "too simple"/"not enough effort" is a close reason on Stack Overflow. It isn't.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:03
  • 6
    Perhaps because we are documentation lookup drones, if the situation calls for it. If you don't want to look up the documentation for someone, you don't have to. No one is holding a gun to your head. How many questions have you ever answered here that didn't involve something mentioned in the documentation? I'd wager < 1%. That's certainly the case for me. The docs don't have to be "insufficient" to make the question on-topic. We're building a resource, a library of information, a set of answers to the long tail of programming questions. That's gonna include some duplication of the docs.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 7:55
  • 6
    @MartinJames "If such documentation is easily found, then the question is unclear..." That seems to be an unusual interpretation of unclear. Clarity usually means that the reader understands what is asked. Do you maybe mean not well researched, which would be a downvote reason? Down and close votes have very similar impacts effectively but if people think that this means one can just use them interchangeably, then my inbuilt sense of order rebels. It just something I can't do. Maybe it's my fault. That's why I voted to reopen and downvoted. Commented Nov 26, 2020 at 10:24
  • 9
    If someone asks a very trivial question, it is indeed not clear to me what is their problem. If a correct answer is self-evident from the question, e.g. "the equivalent of a Python 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. Commented Nov 26, 2020 at 10:34
  • 5
    The objection to misusing close votes as downvotes is not just a sense of order problem, @Trilarion, or a situation where you're being extra fussy. A downvote means, "I don't like this question and don't think it's interesting". A close vote means, "I don't think this question can/should be answered on Stack Overflow." A downvote means you are passing on the question, whereas a close vote is enforcing that others pass on the question, too. They have very different semantic meanings. Each user always has the right to vote as they see fit, but close votes have objective, defined reasons.
    – Cody Gray Mod
    Commented Nov 27, 2020 at 12:07

9 Answers 9

35

Reading too much into the close reasons is a recipe for disaster.

You, as a moderator and curator of the site, are someone with experience, someone with deep knowledge of the developer and the Stack Overflow community. You are entrusted with judging whether a post is valuable or not. You are not a close reason lawyer.

It means you will be subjectively closing questions, and that's ok. The community will keep you in check should you go haywire.

In an ideal world, the software will fit the community like a glove. The values of the community is embodied in the close reasons, where every closure need no extra words and it just ticks, the platonic closure if you will. The world is not ideal, we deal with it.


Now, the post is clearly completely useless. No amount of perfect documentation-as-an-answer will save a person from failing to Google. The next person who finds this useful will be equally served if it doesn't exist: they will find the actual documentation.

Even if you manage to scrounge up the utmost minute scrap of purpose the post may serve, you still have to contemplate the cost versus the benefit. For every second someone spends on this post, they aren't spending it on another one, or god forbid, spend their free time doing anything else.

39
  • 11
    My concerns in this post is that the close criteria appear to be too subjective. Note that every possible close reason other than Dupe, General Computing, and Server Fault, have been used to justify closing this question. This suggests a major disagreement on whether this question is off-topic and why. I feel that we need more objectivity when it comes to close reasons. I'm not saying we should be robots, but a little more objectivity and consistency can't hurt. Also, I don't agree with the "completely useless" part. See my second comment on my question with listing similar questions.
    – cigien
    Commented Nov 25, 2020 at 3:12
  • 4
    @cigien I disagree on "similar". Most aren't even "how do I write a for loop" - they are a lot more specific than that and tackle a specific problem like "I know I can do a for-each loop but how do I do it backwards", or "how do I loop over properties of objects". Stuff not typically found in the first pages of a tutorial of a language. "How do I write a for loop" should be very well covered by entry level introductions to programming. I don't think it's SO's job to do entry level teaching. However, if a user has a specific problem with expressing the for loop, we can help.
    – VLAZ
    Commented Nov 25, 2020 at 7:07
  • 2
    @cigien however, let's leave my opinion on topicality aside. Assuming "how to write a for loop" (or "how to write a for loop going in reverse") is indeed on-topic, I'd find it very surprising if this is the first question SO about it for a tag as large as C++. So, if it's indeed on-topic, would it really be worth it asking again just because a low effort question about this was deleted? Have you checked if yours is the first (non-deleted) question about this?
    – VLAZ
    Commented Nov 25, 2020 at 8:07
  • 3
    @cigien The close criteria for the question should be "lmgtfy". Since we can't get that across politely, we settle for other reasons that may be inaccurate. Your comment listing of questions are a) written in early SO b) not equivalent to your question c) written when documentation might be harder to find. They aren't the same.
    – Passer By
    Commented Nov 25, 2020 at 8:33
  • 8
    @Adriaan I think this answer tries to get across "as somebody who moderates and curates the site". Yes, "moderator" usually means a diamond mod but we all have the ability to moderate the site. The label isn't wrong. It's just not worth using most of the times as people actually mean "diamond moderator" when they use it. I think contextually it fits perfectly fine.
    – VLAZ
    Commented Nov 25, 2020 at 8:41
  • 4
    @PasserBy No, "lmgtfy" is not a close reason, however politely phrased. If I understand correctly, this used to be a close reason, and was removed because it's very hard to objectively judge. Everything is solvable by "googling", by some definition, and it is simply not SO policy to make that judgement. You are welcome to feel like those questions should be closed, but note that your use of any particular close reasons to do so, is at best incorrect, and is probably a misuse of the close vote privilege.
    – cigien
    Commented Nov 25, 2020 at 19:15
  • 7
    @Alexei I haven't set up any filters. Still trying to process this. I was completely unaware that people were broadening the meaning of the close reasons like this, and it does bother me. There is a very good reason that we don't have "the OP is too damn lazy" as a close reason, and it has nothing to do with the site not caring about veteran users and/or needing to cater to new users. I couldn't care less about any "welcoming" initiatives, but would fight tooth and nail to block close reason like the ones being applied here.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:07
  • 10
    @ead Only one side broke the rules here. There's no rule about the amount of research required, and literally everyone who asks for help on a Q&A site is hoping to get a free ride. That's precisely the service we provide: free help.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 7:03
  • 3
    @CodyGray To be clear, I don't care if "the OP is too damn lazy". I'm saying "the internet won't become a better place" by answering the question.
    – Passer By
    Commented Nov 26, 2020 at 9:25
  • 9
    @CodyGray Really? You were not aware that whenever the site owners removed a close reason, the community started to use one (or two) of the remaining close reasons as a placeholder for the old? Seems impressively naïve.
    – Holger
    Commented Nov 26, 2020 at 15:27
  • 4
    @AsteroidsWithWings It is however correct. Anyone can just research enough to become an expert themselves. Then they'd have no need to ask any Question at all, ever. Just spend a few years and anyone will get there. So when exactly is it OK to ask or even find a Question on Stack? After a week, a month, 6 months? Should the site be only for experts? Or should new learners also be able to find anything useful here?
    – Scratte
    Commented Nov 26, 2020 at 21:33
  • 5
    @Holger There was never any close reason even remotely resembling the one people are claiming to be exercising here ("too simple"; "covered by documentation"; "OP is too lazy"; etc.), so, yes, I'm surprised people are inventing new close reasons in their head and using existing close reasons as a proxy for that. Not only am I surprised, but I'm horrified, because that's straight-up admitting abuse of their privileges. If it's naive for me to assume that people would not misuse privileges given to them, then I am naive. And I will continue to be naive. But jeez, this is embarrassing.
    – Cody Gray Mod
    Commented Nov 27, 2020 at 11:57
  • 5
    @CodyGray there was a close reason “OP must show a minimal understanding of the topic” and ignorance toward the available documentation is closely connected to that. Stackoverflow is not meant to replace documentation. There was an attempt to create such a documentation site and is has been abandoned, you remember? Stackoverflow is not that site. Besides that, this site has always been ignorant toward actual close reasons. When I vote to close because X and other people vote to close because Y, my name will be displayed with the “closed because Y” message despite I never gave that reason.
    – Holger
    Commented Nov 27, 2020 at 12:06
  • 3
    Cody also said "That's precisely the service we provide: free help", a statement which contains so many dangerously misleading misapprehensions about this site that I don't even quite know where to begin. It's honestly staggering. Commented Nov 27, 2020 at 18:33
  • 3
    @AsteroidsWithWings Depends on how you see it. If you didn't post the Question, you'd only need to spend a week, 6 months or a decade to find out yourself. If you post, you hope that someone will answer.. for free. How is that not a "free ride"? Did it cost anything other than you've spent time to create the post? I'm not even sure self-answers are less free. Most hobbies are expensive, unless it's stuff like "taking walks" ;)
    – Scratte
    Commented Nov 27, 2020 at 19:22
27

Translation questions are in general*) poor and should be closed.

Instead of asking broad question "How to translate X from A to B" ask yourself those two instead:

  1. What is X in A? (the answer is "It is/does Y")
  2. How to do Y in B.

First question is likely to be asked already or it's a very basic one ("What is range in python"). Consider to spend few minutes to research and read documentation/tutorial. It's a small investment which doesn't cost someone else time and improves your knowledge in A (which you need at this moment anyway).

Second question you likely don't even need to ask. You should be an expert in B already, otherwise you are a wrong person to translate code from A to B.

*) There are exceptions. But imho, you should always clearly explain what you need and the code in another language should at most suppliment your problem (demonstrating what you want to achieve), not be a requirement. More people will be able to help you and to more visitors such question will be useful.

8
  • 3
    I completely agree with this answer and was about to add a similar one which seems redundant now. I was, though, going to write in mine that such questions (at least the example given in the question) are no different than homework questions - "This is my task - now give me ze codez"... There is no problem in asking about code translation, but it should be more like "I translated this line form X to Y. This is how I did it in Y but it's not working as I expected"
    – Tomerikoo
    Commented Nov 25, 2020 at 14:06
  • 4
    @Tomerikoo I do not agree with that at all. I do not want to see Stack turn into a set of debugging posts. HowTo Questions are way more useful. Forcing users to post a contrived failed attempt helps no one.
    – Scratte
    Commented Nov 25, 2020 at 14:18
  • 3
    @Scratte I agree. But it also shouldn't be the place for people looking for shortcuts of going over documentations or tutorials... As I said, taking in count the question in the example, it is basically asking how to do a for loop in C++... I wouldn't, on the other hand, have a problem helping someone that couldn't make his C++ loop work
    – Tomerikoo
    Commented Nov 25, 2020 at 14:21
  • 6
    Stack Overflow is largely a replacement for documentation/tutorials. If a question can be asked and answered here, then a programmer can check here for their answer instead of looking in the documentation. Claiming that we shouldn't answer questions that can be answered by looking at the documentation is absurd. Aside from the fact that most documentation sucks, if we applied this standard, we wouldn't have any questions to answer. Literally every question that could possibly be asked here (save for the opinion-based ones, which can't be asked here) could be answered by reading the docs.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:08
  • 7
    @CodyGray, SO is not really a replacement of documentation (and definitely it would be too broad to compete with books/tutorials), rather a nice addition. Imho SO scope is more about specific practical problems, which are out of scope for documentation, and not too basic things. Documentation is broad, detailed and standartized. See this image, it explains the difference the best. I am not saying "what is range in python" is a bad question, it's simply not needed.
    – Sinatr
    Commented Nov 26, 2020 at 8:04
  • 2
    Yes, everything can be answered in documentations, but there is a difference between technique questions to just basic language constructs. How to do a for loop, IMO, is just too basic and covered in any beginners' tutorial. On the other hand a question like how to get all combinations of a list's elements is also answered in documentations. But for example, in Python someone may not be aware of the itertools library so SO is a great place to find that out
    – Tomerikoo
    Commented Nov 26, 2020 at 12:06
  • @Tomerikoo Except that asking for libraries is off-topic. And asking how to do something is apperently also off-topic (Those wrongly gets closed as "Needs more focus"). So if a user doesn't know about a library and is shot down for asking a simple Question, there's just no way to phrase a Question so that it can be answered with explaining how that tool/library works.
    – Scratte
    Commented Nov 26, 2020 at 13:16
  • 2
    @Scratte I think the problem is that most of these questions simply already exist. Asking how to do something is fine. It is almost always a duplicate...
    – Tomerikoo
    Commented Nov 26, 2020 at 13:21
19

First and foremost: My experience with translation questions tells me that they are better presented as "How to do X" questions rather than "How to translate this Y code into the Z language". This helps future visitors understand and find a solution to a concrete problem, and helps potential answerers who might not know the source language but would be capable of answering if the intended behavior of the code was explained in other words.

That the reposted question contains such a description was a good thing. However, it was not sufficiently good to be well received. And the part where this is perceived as a translation question is not the only problem.

A very similar question was posted in a comment, which provides a general solution for iterating a range in reverse. Its set of answers comprise solutions which work in C++ (some of which are specific to C++ too), and so it basically fulfills the requirements imposed. As such, it would have been an appropriate duplicate target here. Should there be an actual requirement that was not answered in the duplicate target, then the question should have been edited accordingly.

Too trivial, some might say? Triviality is not a reason to close a question, but that hides the very high chances of the subject being already well covered elsewhere. If it's not in official books or documentation, it would be in another question.

In the end, while I would have preferred to see that question closed as a duplicate, consuming our time and sanity arguing over such a simple question is... well... not that worth it. Let us not lose sleep over it being closed for some other reason.

4
  • 6
    Re: Triviality is not a reason to close a question, but: Very, very well put. I really feel like, on the surface, that we have a bunch of SO curators that confuse a question being trivial with a question being closeable. The former is 100% fine, as long as it's a well-developed question in its own right (Now, we could argue that good, trivial questions are rare, but I think to say they don't exist is a stretch). Triviality is not, and should not, be a close reason, and we shouldn't use other reasons to pretend that it is.
    – zcoop98
    Commented Nov 25, 2020 at 16:06
  • 2
    @zcoop98 triviality was not the problem here.. and never was.
    – TheGeneral
    Commented Nov 25, 2020 at 23:08
  • @TheGeneral Not true. There was once a close reason "Questions asking for code must demonstrate a minimal understanding of the problem being solved".
    – Michael
    Commented Nov 27, 2020 at 14:33
  • "Too trivial" was never the meaning of that close reason, @Michael. It meant the same thing as what became "too broad": essentially that I'd have to write an entire tutorial on programming in order to answer your question, which doesn't fit within the Q&A format.
    – Cody Gray Mod
    Commented Dec 2, 2020 at 5:47
7

Instead of needing more focus, I would actually say that this question is too specialized to be of much use. It only deals with a single language translation pair and it only deals with a single language construct, there could be millions of similar questions. It doesn't need more focus, if anything it needs a few canonical resources to be studied (on StackOverflow or somewhere else). I would definitely regard it as not useful for others and would downvote it.

Now, if a question is already heavily downvoted, it hardly matters if it is also closed. I wouldn't close it (except maybe as duplicate of several more general questions about "for" in Python and "for" in C++) but I think this doesn't really make a big difference in the end. But let's say that the closing decision was wrong.

Helpful questions would be:

  1. How does the for construct in Python work?
  2. Is there an equivalent for "the for construct in Python" in C++?
  3. How does the for construct in C++ work?
  4. Which questions should I ask myself when translating code from one language to another?

These are more general then "How can I translate the for construct from Python to C++?".

Now, questions 1 and 3 require one to work through a tutorial of Python and C++, respectively.

If done, question 2 can be answered trivially (yes, there is and it's also called for) and question 4 is partly answered here.

There may be interesting translation questions possible:

  • "How to do X (the equivalent of Y in language A) in language B?" is equivalent to "How to do X in language B?", which is definitely on-topic. The "equivalent of Y in language A" part is just context (which might still be somewhat important).
  • "What is the equivalent of Y in language A in language B?" if the equivalent is not trivial like in the "for" case.

"What are common pitfalls or practices when translating from language A to language B?" would be interesting to me, but would probably be either too opinionated or too broad, unfortunately.

2
  • I wrote this answer over some time and only afterwards discovered other answers by Sinatr and Enet4 or the comment by Dharman, that are spot on. Commented Nov 25, 2020 at 11:31
  • I was finishing writing my own answer when this was posted. Yes, our reasonings are mostly aligned here.
    – E_net4
    Commented Nov 25, 2020 at 11:35
6

Trivial questions are problematic.

In order to properly answer a question, we must be able to gauge both what to answer and how to answer. An answer to an advanced topic needs a very different focus and level of detail than a basic topic. In short, we must identify both the correct solution and the common language to communicate it.

With overly trivial questions, that may well be impossible:
Either we accept that it is asking for an extremely trivial thing, in which case we cannot use even equally trivial language to answer it. Or we already accept a bare minimum of trivial language, in which case that trivial thing is already self-evident and no answer can add anything.

If the question itself is a contradiction, any close reason might apply. Going by the current close reasons, I would recommend such a question Needs details or clarity on what the level of understanding is.


As an example, let's look at the improved question.

The self-evident answer is that the equivalent to a Python for loop is a C++ for loop. But the for loop is a pretty basic part of C++, so what else do people asking that question need explained? Do they know that trailing double-plus thing, or that leading double dash? Can we just assume they know about declaring types? Should we explain that integers come in all sorts of different flavours in C++-land? Is now the time to talk about the birds and the overflows?

The proper answer is that C++ for loops come in two flavours, that one can use that namespace here, that syntax like that, that overloaded operator there (I'm literally just guessing here what the code even is) and in two lines we can present something that is already more abstract and streamlined than even the cobbled together, initial Python code. If people can grok all that in half a page of text, how can they possibly not realise a for loop is the equivalent of a for loop?

And why is the issue to count down from n-2 anyway? Don't people know how to... oh... oh my...

6
  • 3
    I'd like to point out that "trivial" is relative. I might find something to be difficult to understand, that's quite trivial for you. Or vice versa. If you are unable to make a judgement as to whether a specific question is too trivial to answer, or you're unsure about what language to use to answer the OP, you always have the option of moving on to a different question. And you can down-vote if you feel your time was wasted. It's also quite odd that you're simultaneously claiming that the question is too trivial to answer, while admitting that you don't actually understand the posted answer.
    – cigien
    Commented Nov 26, 2020 at 22:42
  • 3
    @cigien Sorry, that is just moving the goal post. Why CV for MCVE? Just move on, perhaps someone else knows how to repro it. Why CV for lack of clarity? Just move on, perhaps someone else feels it has enough details. One can say the same for any reason to CV. Most votes to close are subjective, there is nothing special about this. Commented Nov 27, 2020 at 5:31
  • 3
    @cigien I'm am not claiming the question is trivial to answer. In fact I am claiming the exact opposite. That the current answer is not clear to someone having to ask in the first place is the point. Commented Nov 27, 2020 at 5:33
  • I'm not moving the goal posts, I'm trying to identify where they are. I CV as "No MRE" when I think that no one can answer the question without an MRE. Similarly, I CV as "Needs Clarity" when I think any answer would be a guess. OTOH, for a trivial question, I have no choice but to move on. To CV a trivial question means I don't think there's any possibility of a useful, or new answer could be added. But I have to account for the fact that my imagination is limited, or that I'm ignorant of potential solutions, and so I have to leave the question open.
    – cigien
    Commented Nov 27, 2020 at 20:24
  • 3
    @cigien Well, I have laid out why I think such a question is genuinely not answerable without guessing. So I don't see why this is suddenly about personal difficulty to understand, or inability to make a judgement, or limited imagination, or ignorance of solutions – seemingly just because this is a trivial question. Such questions are first and foremost in need of detail and clarity required to be answerable – that they need detail because they are trivial should not give them special pleading versus those that need detail due to other reasons. Commented Nov 27, 2020 at 20:39
  • Ok, if you think the question is not clear enough to be answerable then voting to close as "Needs Details or Clarity" is definitely the right thing to do.
    – cigien
    Commented Nov 27, 2020 at 22:56
6

Here is the OP for the original question, I didn't expect my question to get this kind of discussion but here is my take on the whole thing.

First, for the people who commented on the question and told me to read a book (comments now deleted it seems), I have a Bsc in Computer Science and have been programming in C++ & Python for more than 7 years now.

Why I posted this question? I was converting a 50 line program from Python to C++, I was getting wrong results and managed to narrow the issue to the for loop mentioned in the question, I've gone through it many times and read Python & C++ docs and wasn't able to figure out what the issue is, so I thought I can post it here to get some help.

The rest of the code is irrelevant, it will only complicate the question more, I know my question was specific, but as I saw, there are dozens of similar questions to mine, so I thought I can post it and ask the community.

This is the for loop in Python:

for i in range(n-2,-1,-1):

The C++ code I already converted before posting the question and had issues with it was:

for(i=n-2; i<-1; --i)

It turns out all I needed is to put larger instead of smaller since it's decreasing ' i>-1 instead of i<-1 ', it's a trivial thing and I don't know how I missed it, it happens to anyone, but I managed to solve it and decided to delete the question, although someone answered it seconds before deletion.

Why I voted to delete my own question? Honestly, I was surprised by the comments I got, read a book, know how to ask, ..., I didn't understand why and felt more discouraged and frustrated from StackOverflow after I saw it as a place where developers help and encourage each other, not the opposite.

4
  • 7
    Thanks for sharing the background of your question. Quite frankly, this is exactly the kind of information that should have been in the question. Commented Nov 30, 2020 at 9:07
  • 2
    If your issue was an incorrect symbol, then the question probably would've ended up closed as a typo question anyway. I'm glad you managed to figure it out on your own, though; it happens to the best of us, so don't sweat it.
    – F1Krazy
    Commented Nov 30, 2020 at 9:28
  • 1
    @F1Krazy I loathe that close reason. It's one thing when someone has a variable named foo and posts "Why do I get undefined variable ofo", it's another thing to use the wrong mathematical operator or having an off-by-one error. Yes, they are trivial to spot with experience, less so without. At least close as duplicate, not as typo. Don't abuse the "typo" close reason for "OP lacks understanding", because that close reason is gone.
    – CodeCaster
    Commented Nov 30, 2020 at 13:41
  • 2
    @MisterMiyagi agreed. It goes to show that the how to ask advice is correct and we should be all be trying hard to avoid XY problems. "how do I write a backwards loop" is a different question to "I have this backwards loop, why does it behave not as I expect".
    – VLAZ
    Commented Dec 1, 2020 at 12:58
2

I commented on your answer, because I really think that a correctly presented answer even on a poor question has some value, and if someone has wasted some time to write it, they deserve some respect (both the answer and the answerer). Furthermore, you even presented an advanced way and then added the classic way in response to comments, so IMHO the answer largely meets the quality standards of Stack Overflow.

But without the answer, I would have VTC the question. I am not sure about what I would have check as the official reason, but the real reason would be too trivial for a Stack Overflow question and lack of research because it is about the basics of the language.

We expect developers to ask questions, and you cannot pretend to be a C++ developer if you do not know the C-ish for loop syntax. Said differently it is close to how can I add two integers numbers in C++, and I think that those kinds of too trivial questions have nothing to do on Stack Overflow.

So my opinion is that the close reasons are probably irrelevant, but the question is indeed off-topic.

12
  • 16
    It is extremely distressing for me to read all these answers from users who are basically admitting to misusing their close-vote privileges in a misguided attempt to close questions because they think they are "too trivial". You admit that the "real" reasons you would have closed the question were triviality and lack of research, but neither of those are close reasons here. There is no such thing as question that is too trivial; our scope doesn't make that judgment. Lack of research effort is a downvote reason, but not a close reason. Being a developer doesn't mean you know everything.
    – Cody Gray Mod
    Commented Nov 25, 2020 at 10:02
  • 7
    @CodyGray: I acknowledge that I am inclined to VTC poor questions instead of just downvoting them. I respect your advice and will try no to do it any longer. But I really think that questions like that add no value to the SO site, and give little help if any to OP, because if they could not find the answer by themselves, I am afraid that I cannot help them. It can be different if some context is added like I an not used to that language and only need to understand/change/add that thing. But you are right on the point: it is not a legitimate close reason on SO. Commented Nov 25, 2020 at 10:18
  • 1
    @CodyGray I am one of the guilty, but correct me if I'm wrong, VTC means to me the question is not worth anyone's time. I check out negative score questions, but I skip all the closed questions, which is how I assume it should be, closed questions are even hidden for some. Closed question is further staged for deletion if it doesn't receive an edit, because, again, it's not worth anyone's time.
    – Passer By
    Commented Nov 25, 2020 at 21:36
  • 4
    I'm definitely not going to argue that anyone should spend even a second longer thinking about or dealing with crap questions. But I really don't think cigen's original question here counts as crap. I continue to be puzzled why you think that question and its answer(s) add no value to the site. It certainly has at least as much value as any of the plethora of "debug my code "questions that you and others will happily answer.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:11
  • 3
    @PasserBy No, VTC does not mean "the question is not worth anyone's time". That's what a downvote means. VTC means "the question meets the description for the close reason that I picked". Specifically, VTC means, "this question is not suitable to be asked/answered on this site".
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:11
  • @CodyGray But "this question is not suitable to be asked/answered on this site" is equivalent to "the question is not worth anyone's time" in spirit. It's not my time, it's anyone's time, or rather anyone on SO. Why else do we think it's not suitable?Just because it coincidentally pattern-matched into one of the close reasons?
    – Passer By
    Commented Nov 26, 2020 at 9:06
  • 7
    The close reasons we have here are not a coincidence. They come from logical thought and years of experience about what does and does not work on a Q&A site. The purpose of the close reasons is to avoid the types of questions that we know don't work in a Q&A format. It isn't to gatekeep information. You deciding that the question isn't worth your time is a downvote reason. Closing simply means that the question is unsuitable to be asked and answered in our Q&A format. Nothing more, nothing less. I have no idea why you think this one is unsuitable.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 9:09
  • 2
    There's an certain irony to answering a debug Question that is very unlikely to help anyone else, but the Question author. How exactly is it less likely that the translation Question would help anyone?
    – Scratte
    Commented Nov 26, 2020 at 13:11
  • 2
    @Scratte: The C-ish answer already exists in any C or C++ tutorial, and should be known to any C or C++ programmer. Because of that I think very unlikely that someone else ask the exact same beginner question. Commented Nov 26, 2020 at 13:21
  • @SergeBallesta I do think you are right about that. I look at Java posts, and again and again users ask the most basic Questions. There is no canonical for each of the different types. If there had been and a search would show them, it would make it easy for users to find them and make good duplicate targets. I used to search for those and only by reading posts on other sites, did I get my answers (Some times I'd find it on Stack, thankfully). Tutorials are a great resource, but sometimes there's a missing link that makes it harder to understand why something works.
    – Scratte
    Commented Nov 26, 2020 at 13:28
  • 4
    @CodyGray I don't think we're communicating effectively. Closing is about clearing the noise out so people can see the signal. When a question is not worth anyone's time (not mine), it's noise, and it's unsuitable to be asked. The close reasons are the closest approximation of a definition of noise, but it's not perfect. Why I think this particular question is unsuitable is written out in my answer.
    – Passer By
    Commented Nov 26, 2020 at 16:38
  • 2
    @PasserBy You are confusing close votes and downvotes. What you describe ("I think this is noise, and it shouldn't get in anyone's way") is actually the purpose of downvotes. Close votes mean that this question violates one of the established guidelines for what is allowed to be asked/answered on Stack Overflow. If it doesn't violate one of the guidelines in our list, then, whether you think it's noise or not, it is on-topic and it should not be closed. You are, of course, welcome and even encouraged to downvote it, which reduces its impact.
    – Cody Gray Mod
    Commented Nov 27, 2020 at 12:11
0

Deleted, downvoted, or whatever. This type of question should be strongly discouraged.

One thing I have noticed since COVID-19 quarantine began this Spring is an enormous uptick in SO questions that can be easily translated as, "Please do my homework for me," or (worse), "Please do my job for me so your effort will produce income for me," or, "Please do my job for me because I don't belong in this business. I have a background in [anything else], but SO allows me to fake being a computer programmer."

I have never written C++ and spent a couple days investigating Python over 5 years ago. Using W3Schools, I just figured out how to answer the original question. It took me 8 minutes. So, if the person asking the original question had put forth minimal effort, the question would not have been asked.

8
  • 4
    Except.. most of my simple questions when I'm learning new stuff is answered from a post I find on Stack Overflow from a search.
    – Scratte
    Commented Nov 25, 2020 at 18:35
  • 4
    It's not clear from your answer why you think this type of question should be discouraged. Your point that the question should never have been asked in the first place, is reasonable. However, this discussion is about what to do with such questions if they do get asked, and in particular, whether they should be closed, and maybe later deleted. I'm fine with the down-voting of such questions, but your answer conflates that with deletion, which are different things.
    – cigien
    Commented Nov 25, 2020 at 19:29
  • 3
    Maybe I'm wrong, but I see SO as a community where people can, after putting forth a reasonable amount of effort, learn from the experience of others by asking focused questions. That leads to better understanding of how (in this case) software and programming languages work and promotes thought and development of better solutions. The question asked is more about socialism: Everyone can eat for free if we can just get a handful of people to do all of the work. That way leads to societal decline. After a while, the few who were doing all the work will burn out. Then everyone suffers.
    – dougp
    Commented Nov 25, 2020 at 20:57
  • 4
    So... you think that a Q&A site should only be for questions that are difficult to answer? How is it our business how much effort the asker puts into their question? There's probably not a single C++ question out there in the world that I couldn't answer with a few hours to a few days worth of research time. Does that mean I can't/shouldn't ask any questions here? I think this is absurd. Obviously, questions where someone is trying to get others to do all their work for them are a bad fit. But "How can I build a Facebook clone?" is easily closed as lacking focus. This ain't that.
    – Cody Gray Mod
    Commented Nov 26, 2020 at 4:15
  • 2
    Yeah I follow what Cody Gray says, an easy question does not imply a bad question. BUT! Such questions are very likely already asked and answered on Stack Overflow itself; not having any kind of push back to these kind of trivial questions (easily answered by doing ANY research, not specifically looking at the documentation) is not great either. Unless we officially want to have endless dupes, in which case it really is time to send out a memo because poor Cody can't convince meta on his own.
    – Gimby
    Commented Nov 30, 2020 at 15:20
  • 2
    @CodyGray I'm not talking about hours or days. It took me 8 minutes. Why are we doing work for those who have zero interest in knowing how to do it for themselves? I directly assist users with software. I tell my users to battle with a problem for 20 minutes before calling me. The battle will help them learn, but after 20 minutes, they're just wasting company money. The person asking this question spent 20 minutes figuring out how to craft a question for SO instead of how to solve their problem. In fact, they could have answered the question faster than asking it.
    – dougp
    Commented Dec 1, 2020 at 16:42
  • @dougp That's what a Q&A site is: doing work for other people who take the time to ask a question. This isn't a Help Desk. The motivations and concerns are not the same. It isn't our job to teach people how to be better at their jobs, be smarter people, save the company money, or whatever else. In fact, the person who asked the question is almost completely irrelevant. Asking the question probably took them longer than it would have taken for them to research and find the answer. But asking and answering the question helps legions of future searchers: our whole concept.
    – Cody Gray Mod
    Commented Dec 2, 2020 at 5:43
  • @Gimby If they're dupes, close them as dupes! If not, answer them, so we can close future questions as dupes of that one! I am not trying to endorse leaving duplicates open. Only that lack of research effort is not its own close reason.
    – Cody Gray Mod
    Commented Dec 2, 2020 at 5:44
-2

I could repeat myself on close reasons, but instead I'll just link to a previous answer I've posted: https://meta.stackoverflow.com/a/402596/70345 - the tl;dr is that close reasons don't matter. While I do try to choose the reason that best matches why a question is bad, at the end of the day the reason isn't as important of getting a bad question shut down ASAP.

How do I know a question is bad if it doesn't fit the predefined closure reasons? It mostly just boils down to experience... I've seen a lot of questions, most of them bad, and by the time you've seen a thousand you've got a pretty good feel for what's outright bad. More formally, there are "tells" that I look for both consciously and subconsciously - one of the most important ones being "why is the asker wanting to do this?", discussed more fully at https://meta.stackoverflow.com/a/402020/70345.

Onto your test question: I voted to close it as "needs debugging details", because unlike the questions I close as "needs details or clarity", yours actually includes (a) a problem statement (b) code. Congratulations on posting a better question than at least a quarter of the new users on SO!

But that's about where the good part of that question ends. First, it fails to explain why you want to do this thing that you (think you) need to do, which makes me wonder if you understand why you're even asking the question to begin with. Then, a question asking to translate a single line of code - without context - is hardly likely to be useful to anyone at any point in time in the future. And the only way I could see anyone having difficulty translating a basic loop is if they either don't know the basics of loops, or know nothing about the syntax of looping in that language - both of which are solved with Google.

At the end of the day, it's almost the exact opposite of a question that's likely to draw many high-quality answers and help many people in the future. As such, it simply doesn't belong on a site that's ostensibly about providing a high-quality repository of Q&A.

8
  • 16
    We're a collection of people. Those that post should be able to understand why their post is closed. Just picking some reason doesn't help with that at all. It just creates confusion. And it creates even more confusion when the help center doesn't even cover why anyone would want to close the post.
    – Scratte
    Commented Nov 24, 2020 at 23:26
  • 12
    "both of which are solved with Google" because Google links to Stack Overflow. Commented Nov 24, 2020 at 23:29
  • 20
    1) I find your implication that you use close reasons merely as an excuse to justify your feelings about whether a post should be closed, to be troubling. 2) My motives for wanting to do something are my own. So long as I have provided sufficient information for the question to be answered, my motives are irrelevant. 3) A question being easy to "google" is not a close reason, it's only a down-vote reason as it shows lack of effort. 4) Please see the second comment on my question above where I list similar basic-loop questions that have clearly been valuable to many people over the years.
    – cigien
    Commented Nov 24, 2020 at 23:33
  • 8
    Although this is likely to get downvoted into oblivion. I agree with the sentiment. The types of questions in the OP are useless for stack overflow (even if there are historical examples). Stackoverflow is not a documentation site (in all but the most extreme examples). It shouldn't be used to post trivial questions that are easily found by documentation, the flood gates will open. When a question obviously fails the basic standards (and the spirit) of SO, there is a custom close reasons. It points to the basic documentation. There are also comments to explain any further information
    – TheGeneral
    Commented Nov 25, 2020 at 1:14
  • 6
    Glad to see that this website has continued to fail upward in the past ~10 years since I stopped contributing because of reasons like this one. If the only goal is to convert a community into a machine that bubblesorts good-ish Q&A onto Google at the expense of many, many people's wasted time, effort and sanity, it's successful. If its goal is to help anyone with any question that has even slightly complex answers, it's nothing but a trap and an obstacle to something better. Commented Nov 25, 2020 at 1:19
  • 4
    @CrisLuengo No. You google the question title and you see an entire page of C++ for loops tutorials.
    – Passer By
    Commented Nov 25, 2020 at 1:54
  • 5
    @TheGeneral "Stackoverflow is not a documentation site [...] It shouldn't be used to post trivial questions that are easily found by documentation" - wrong. Documentation generally sucks, and on Stack Overflow you'll find examples, caveats, discussion about the best approach, and so on. It is functioning exactly as designed. There never has been and never will be a barrier like "this problem must at least be X exciting for the answerers".
    – CodeCaster
    Commented Nov 25, 2020 at 11:05
  • 3
    @CodeCaster fully agree with what you said, though it was far from my point, and even further from the point of the OP. asking about a for loop is at the lowest end of usefulness, even for a homework site.
    – TheGeneral
    Commented Nov 25, 2020 at 11:59

You must log in to answer this question.

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