21

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.

2

3 Answers 3

31

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.

5

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.

4
+100

For the sake of argument, let's presume that there are the following Stack Exchange Q&A sites (any resemblance to existing SE sites is coincidental):

  • Automotive Engineering — A Q&A site dedicated to vehicle engineering, incorporating elements of mechanical, electrical, electronic, software and safety engineering as applied to the design, manufacture and operation of motorcycles, automobiles, buses and trucks and their respective engineering subsystems.

  • Auto Mechanics — A Q&A site dedicated to helping automotive mechanics diagnose and repair vehicles, and to ask about business aspects specific to the automotive mechanic industry.

  • Cars — A Q&A site dedicated to discussing the performance and features of automobiles.

The Big Question

Let's say that our hypothetical OP wants to modify his DeLorean DMC-12 to add a custom part. This part will require more power than the automobile battery and electrical wiring harness is currently able to supply to the part. He now comes to the SE network with this 'big-picture' question in mind. So which of our hypothetical sites should he ask this on? None of them.

How To Ask the Big Question

His current question is too broad and not entirely on topic anywhere. So what this OP will have to do is break his question down into a series of questions and ask them in multiple locations. Some of his questions may not be welcome on any of the sites so he may need to do some research to answer those on his own. Here is how our wise OP will go about asking his 'big question':

On Automotive Engineering.SE, the OP will ask the following:

Note that the OP already did the work of designing a prototype and is now asking the community to objectively determine whether the design is capable of safely delivering the power needed for the custom part.

On Auto Mechanics.SE, the OP will ask the following:

  • How do I securely mount this custom part between the front seats of a DeLorean DMC-12?
  • This modified wiring harness doesn't fit behind the driver's side rear quarter panel on a DeLorean DMC-12, how do I get it to install without having to modify the entire harness?

Note that the OP did not ask how to install the entire part and wiring harness in one question, he attempted to do/understand it himself and then asked only about the specific areas where he had trouble.

On Cars.SE, the OP will ask the following:

Here are some remaining questions that the OP tried to ask but they were closed as off topic on the various sites:

  • How to install a wiring harness on a DeLorean DMC-12? (The closest fit was Auto Mechanics.SE, but they told the OP he needed to learn this on his own as it was too broad and showed no initial research effort. The site does not exist to teach you how to be a mechanic, but to help mechanics with actual issues they face. The OP ended up finding a book on this and learned, and then only asked about a specific portion of the install where he was having trouble).

  • What battery will supply 1.21 GW to a custom part? (This was closed as 'searching for a product recommendation'. This type of question is not well-suited to most sites on the SE network because answers are often too localized, among other reasons).

  • How to obtain plutonium? (No one was able to help the OP find plutonium and this question was closed as too localized, although he received numerous comments about Benghazi and Libyan terrorists).

  • The big question itself (This was promptly closed as 'too broad' everywhere the OP asked it and most of it was off topic on the various sites anyways).1

Did the OP's Big Question Get Answered?

In the long run, through the OP's continued research efforts combined with assistance from the various SE communities, the OP managed to accomplish his objective. But he wasn't able to come to any one site with this 'big picture' question and get all of it answered in one place. This was somewhat frustrating in the learning process, but in the end the OP learned to appreciate site scope and that this limitation allowed communities of experts to form around the specific aspects of automobiles that they know well (because automotives is a big field).

In summary, you may only be able to ask a part of your question here, and you will need to ask other parts elsewhere. Some parts may not be welcome anywhere, in which case you will have to conduct independent research to find your 'big answer.' This 'specialization' allows SE communities to gather around specific aspects of topics of interest within their respective fields and is common to the entire network.


1 I actually greatly simplified this analogy because this post is already too long. The original version specifically mentioned the design of the 'flux capacitor' (custom part), had related questions for Physics.SE, a question for Skeptics.SE about the location of plutonium globally, a spelling question about 'jigawatt' vs. 'gigawatt' for English.SE, and an ethical question about time travel for Philosophy.SE.

The majority of this answer is from a meta post I wrote for a specific site that I figured I'd share what I think are helpful parts of with the broader community.

You must log in to answer this question.

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