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

For long code, what should I do?

  1. write down all the code in body content
  2. Parse the snippet and link the rest of it using pastebin
  3. post the pastebin URL only.

And, how long is long?

share|improve this question

3 Answers 3

If you feel you need that much code to ask a question, the question is probably wrong. Or, at least, a bad fit for Stack Overflow.

share|improve this answer
2  
I can take conclusion that the better solution / question is, to give short snippet and post the long one on pastebin. –  ariefbayu Nov 2 '09 at 6:47
    
yes, that is a good compromise -- show the relevant bits and put the rest behind a link. –  Jeff Atwood Nov 2 '09 at 7:49

Ideally you should make it short enough to fit in the normal question length. I've yet to see a good reason for more than about 80 lines of source in a question on SO.

share|improve this answer

You should keep the code to the minimum capable to explain your inquiry/problem.

In my experience, more than 100 lines is too much.

You should always try to post the smallest possible code showing the problem.

share|improve this answer

You must log in to answer this question.

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