-3

Link to question: Problems freeing memory and moving data between arrays in CUDA

My question on Stack Overflow was closed due to needing to be "more focused". It says I should edit the question, but I'm not sure exactly what improvements are required.

The following shows an outline of what my question looked like when this meta discussion was started:

<Brief introductory description of what my code should do>

The code:

<My code>

The results:

<Two different outputs from the program from two different inputs>

Expected results:

<Asking about an error>
<Highlighting an incorrect intermediate result>
<Highlighting incorrect final result>

Non random version:
  (Someone said that the random generator made the code hard to debug)
<Alternative int generation function that does not produce random array>

Non random results:

<The two outputs as before, but with the new generator>

Expected results:

<The results I'd expect with the new generator>

Working previous code:

<Old code I had before I encountered the error>

<The results with the previous code for three inputs>

Key:
<TEXT> = Outline of what I wrote at that point in the question.
TEXT = Heading from my question.
(TEXT) = Extra bit of information.

To clarify, the above is not my question. It just shows an outline of how I've laid out my question. Furthermore, it is outdated now that I have made some edits to my main question.

  • My question highlights three different errors, however since I am asking for help debugging, it's hard to narrow down on a specific error. I can't say for sure if my errors are being caused by the same bug or if they're unrelated, until my question is resolved.

  • My question shows two different outputs, but I feel this is necessary to show these, as they allow me to be more specific about my expected results.

  • My question uses an extra version of an existing function, but this is to help people who might have a different random seed, so they can get the same results as me.

It says "Update the question so it focuses on one problem only.", but my question already focuses on one problem only.

Why was my question closed in the first place? What criteria does it need to meet to be "more focused"? Is there any way I should apeal my question to try to get reopen votes?

3
  • 8
    It's quite hard to read, because of the way it's laid out (and the sheer volume) I actually had trouble finding your question in the wall of text (and I'm still not entirely sure if I did), it could probably use a (large) amount of re-organizing and trimming down with a clear and concise definition of what you want Jul 30, 2021 at 12:46
  • 7
    Your question needs scrolling through several pages of text, embedding a code block that also needs scrolling. The question might be asking about one problem, but it does not focus on it. Jul 30, 2021 at 12:52
  • 3

1 Answer 1

16

To quote https://idownvotedbecau.se/toomuchcode/:

It is really hard to answer a question about a bug in code when the question includes a huge block of code. When this happens, it takes much longer and is much more difficult for other users to search through the code to find the pieces that are relevant to the problem.

Stack Overflow users give their time for free. If you want your question answered, you need to incentivise them to do so, and one way is by making your question take as little of their time as possible, and the best way to do that is to ensure that your code is as short and sweet as possible. Hence the rule that your code must be a Minimal, Complete, Verifiable example of the problem: it helps us to help you.

Another important reason, that's not stated on the linked pages, is that by distilling problematic code down to its bare essence, you often figure out the bug by yourself. This has happened to me more times than I can count, and every time it does, I'm reminded if that I hadn't made the effort to follow the rules, I might have asked that question and never got an answer.

4
  • 5
    Also worth remembering: "With your help, we're working together to build a library of detailed answers to every question about programming." (from the tour). It's not a free debugging service. Jul 30, 2021 at 13:17
  • 2
    Thank you. I am currently editing the question in question to highlight the code that I suspect is causing the issue. Jul 30, 2021 at 13:17
  • 4
    @SuperS - You don't need to break your question down into sections. Just write a question. You don't really need headers, or section breaks, just the code and a clear and precise question. Since I assume your not interesting in using the old code, it's unnecessary, but your expected output is necessary. Be sure you format all that information to be clear and concise. As other have indicated, your question content, was excessive minimal examples would are best. Jul 30, 2021 at 15:21
  • @SecurityHound I have removed the old code section and merged some of the sections. Jul 30, 2021 at 15:41

You must log in to answer this question.

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