-19

Sometimes, there are circumstances when a question involves a lot of code, maybe 2 or 3 files, so adding this many code blocks make the question too long that some people tend to ignore it.

Is it possible to add an option to attach a code file so that a little code snippet can be shown?

I feel that would be easier for OP and people answering too.

5
  • 2
    This is related: meta.stackexchange.com/questions/211565/…
    – rene
    Commented May 6, 2014 at 14:11
  • 1
    Those two points in the answer explained pretty well :) Commented May 6, 2014 at 14:13
  • You could always link a github project or dropbox links. No need to add that feature to SO.
    – C0L.PAN1C
    Commented May 6, 2014 at 15:36
  • 1
    @AmitApollo If your question relies on a github project or dropbox link to be understood, it is not a good fit for SO. Commented May 6, 2014 at 18:05
  • that's a good point. Just offering it up as a suggestion or alternative for attaching source files to SO. You could upload your .cpp, .java, .c, .h, .m, .hh, .mm, .cs, .vb, .php, .js, .vbs, .bat, .cmd, etc, etc file(s) applicable.
    – C0L.PAN1C
    Commented May 6, 2014 at 22:33

2 Answers 2

40

You shouldn't be including that much code in a question. If you have that much code then your question isn't ready to be posted yet. You need to spend some time going through your code and creating a minimal reproducible example of your problem, rather than just throwing the whole project up and hoping someone else will sort through it all to find your problem.

2
  • what if there is no smaller working example?
    – Demi
    Commented Jul 1, 2014 at 16:15
  • 11
    @Demetri Then the scope of your problem is almost certainly too large for SO.
    – Servy
    Commented Jul 1, 2014 at 16:18
8

We aren't compilers and don't catch errors. It is up to you to figure out which part of your code is going crazy and then you'll have to paste that code on SO, also if it is large, you should paste small code which explains your problem clearly. Also, you should put relevant info which you think will help us figure out your problem in the question.

Even now, without that option which you are asking for, people just paste the whole chunk of code and believe me, that by doing so, you are gonna be on the losing side as people will not have the patience to look through your code, if it isn't interesting and just code only question without any context.

1
  • 2
    Questions with long blocs of code also tend to get downvoted, especially when the people obviously haven't gone through them. Commented May 6, 2014 at 14:27

You must log in to answer this question.

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