What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

After spending way too much time trying to find an annoying bug in my source-code, I thought of posting it on Stack Overflow. However, posting is would involve a lot of source-code, and a lot of explaining, resulting in a wall of text for the reader. Would it be best to posting the question, and referencing to source-code stored elsewhere, or is it acceptable to post a question that easily takes up a few pages?

While I'm sure some might find my problem intriguing, I'm also sure others will find it too long to bother reading, so I was wondering if there was a general policy on this.

It should be noted that the problem/bug in question is probably not very useful to others, except that some users might find the source interesting and would perhaps want to use it for as project of their own.

share|improve this question
    
This may help meta.stackexchange.com/questions/28102/… –  Ajeet - HoneyDreams Jan 25 '12 at 6:48

2 Answers 2

up vote 4 down vote accepted

If you do post a huge wall of text, I'm going to confess right away that you've got maybe first paragraph or two to convince me its worth my time to read it. I suspect I'm not alone in this. In particular:

  • The question had better be written in proper English, or something close. It needs to be easy for me to read. Judging by your question, this won't be a problem.
  • Convince me that you've actually spent time on this, and you're not just asking SO to do your work for you. (I have no doubt this is true of you, I don't think the plz-send-me-teh-codez folks even know what meta is).
  • Convince me that you're competent enough (by describing actions, not providing a resumé please), and that you have a single issue that needs fixing. In other words, that this question is answerable. The 20-comment chain of "teach someone C" isn't very rewarding.
  • Give me a brief overview of what this code does, so I can tell if I'm at all qualified to help. Keep in mind the tags are burried under the wall of text.
  • Give a brief overview of the issue.
  • Give a brief list of requirements I'll need to run this code.

That's a lot to do in the paragraph, of course. The stronger it starts, the more likely I am to keep reading. That's a confession of reality of course.

Once I've decided to try and help, here's things that will help:

  • make sure its very clear what goes wrong. "On line 13 (obj->doBlah();) it segfaults."
  • make sure you've tried all obvious debugging steps. E.g., run it under valgrind, trace through it with a debugger, etc. ("valgrind doesn't find any problems, and p obj and p *obj in gdb both look OK to me. If I set a breakpoint on the first line of doBlah, it doesn't get there.")
  • unless the problem is "this doesn't compile", I expect it to be easy to compile. The easier the better. This isn't the problem we're trying to solve, please make it painless. Just let me type 'make', or copy & paste a command line. If its multiple files, consider linking to a tarball as well (to save me time copy/pasting into a bunch of files). Actually, consider a download link even if its one file.
  • please replace all nonessential code with stubs, or remove it all together. Mock all non-essential objects. Its only essential if removing it prevents replicating the problem. The fewer lines of code I have to read, the better
  • please explain the code. This can be in comments, or it can be in the question. Please don't anonymize the code to obscurity (e.g., if all subroutines are named A(), B(), C(), that's going to be painful)
  • please test the exact code you're putting in the question. I know I've certainly made the mistake of looking at something, seeing one trivial thing I forgot to change, and made a stupid typo.
  • before posting, ask yourself "is there anything in my code or question that might hinder people from helping me? Can I fix it?"

It seems like you understand that the question is more important to you than it is to me (or anyone else here), and thus that you should be willing to put in in the most time on it. That's a good sign.

share|improve this answer

I and many others appreciate the care that you are taking in inquiring about posting the question you have in mind. From what you have said here, alone, I suspect your question may not be well received.

  1. Questions with large blocks of code can be almost impossible to comprehend, and tend not to be a good fit. It is difficult and extremely time-consuming for us to help with such a question.
  2. Needing to post so much code suggests you may not have a solid handle on where the bug really is. Issues of the amount of code you would post aside, that also makes it a potentially poor fit for the relatively fast-paced question/answer format.
  3. You've also pointed out another important issue in your last sentence: One of the items we consider with questions is would the question (and its answers) be useful to other people who may have the same or similar trouble. Our list of reasons to close questions includes one made for this sort of situation: "Too Localized".

I think you might want to try to narrow things down before asking, such that you can post a smaller description and code block for your question. Note that it might even be appropriate to post a question geared toward helping you find the exact problem, assuming you can narrow it down enough. That kind of question is sometimes hard to formulate usefully, but it's worth a shot.

share|improve this answer

You must log in to answer this question.

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