For long code, what should I do?
- write down all the code in body content
- Parse the snippet and link the rest of it using pastebin
- post the pastebin URL only.
And, how long is long?
Meta Stack Exchange is a question and answer site for meta-discussion of the Stack Exchange family of Q&A websites. It only takes a minute to sign up.Sign up to join this community
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.
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.
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.
It is better to just include the important lines in your code; however, sometimes you can't realize that other parts of the code are relevant too. So, in same cases is good to include the whole code. For that reason I think Stack Overflow should have the option to include an option to attach code in files, or maybe a pastebin like solution.