Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 158 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

Sometimes there's need for including large chunks of data/code in a question. (See comments to the question: the OP tried to include a couple of long XML files, but that wasn't possible.)

What's the recommended approach to including code/data, when there's just too much of it to embed in the question?

I could think of a few approaches myself:

  • Paste the data to a pastebin and link (and wait for the links to die)
  • Encode the (compressed) data in an image and include that (kludgy!)
  • Implement an attachment feature in Stack Overflow (which will probably be abused)
share|improve this question
This question has been addressed before: Posting lots of code in a question, Asking a question with lots of source code. – Cody Gray Apr 15 '11 at 9:09
But there's no such thing as "too much code to embed in the question". I've never had the system reject a question or answer for being too long, and if it does, then you seriously have too much code. It's unreasonable to suppose that a snippet that long can't be trimmed down any further. – Cody Gray Apr 15 '11 at 9:10
@Cody Gray: I do agree that mostly posting a lot of code equals a bad question, but is there no case at all where it's necessary? Sorry for the duplicateish question, I couldn't find a similar question with the search function. – dancek Apr 15 '11 at 9:20
Fair enough, the search function has been roundly criticized before. Don't take it personally when people point out duplicates. I suppose that a known-trustworthy site like pastebin is the best option if something like this is truly necessary. But I've never seen it. Personally, there's a -20% chance that I'd ever read that much code. There'd better be a heck of a bounty attached. – Cody Gray Apr 15 '11 at 9:22
up vote 16 down vote accepted

Nobody needs to throw ten tons of code into a question.


Plus, tl;dr syndrome guarantees that the more crap you throw in a question the more likely it is you won't get an answer.

Hell, I think the max question length should be dropped by 3/4. I've heard that skill in asking a question is more important than length. Or was it column width? Anyhow, a massive code dump smells like what it sounds like. Stop it. Don't.

share|improve this answer
+1. “If I had more time, I would have written a shorter letter.” -Marcus Tullius Cicero, philosopher and statesman. – Piskvor Apr 15 '11 at 15:12
Absolutely "tl;dr syndrom guarantees that the more crap you throw in a question the more likely it is you won't get an answer" - when I see walls of code, I generally just post a comment asking them to pare it down or I just move on, I don't even bother trying to dissect the whole thing. – Daniel DiPaolo Apr 15 '11 at 15:17

You must log in to answer this question.

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