If you are having a problem with some code and seeking help, preparing a Short, Self Contained, Correct Example (SSCCE) is very useful.
But just what is an SSCCE?
It is all in the name, really. Take a look at each part. The version you prepare for others to see should be:
- Short (Small) - Minimise bandwidth for your example, do not bore the audience.
- Self Contained - Ensure everything is included, ready to go.
- Correct - Copy, paste, see is the aim.
- Example - Displays the problem you are trying to solve.
And why should I do this?
It shows other people that you are serious about wanting to be helped.
If you just dump a load of code in a post and go “It don’t work”, the chances are that you’ll be ignored.
If you make a concise, self-contained example that allows someone to see your issue immediately, then your chances of getting a response will be considerably higher.
Also, in the process of making a SSCCE, you more often than not chance upon the solution to your own problem.
A lot of folks feel quite strongly about this concept, so much so that they have made a website dedicated to this very subject.
I suggest you visit it and read it before posting code: http://sscce.org/