SSCCE : Java Glossary

*0-9ABCDEFGHIJKLMNOPQRSTUVWXYZ (all)

SSCCE

SSCCE (Simple Self Contained Compilable Example), a term coined by Andrew Thompson email Andrew Thompson to describe the desired form of code snippets posted in newsgroups.

If someone asks for a snippet or an short example to demonstrate a problem, they really mean a SSCCE, but just don’t want to use a potentially unfamiliar term.

When you post some code on the Internet, your odds of getting help with it are greatly improved if:

If you refuse to take the effort to create an SSCCE, and still expect others to help you, at least — Post the complete code!
If you expect others to be able to diagnose the problem without the complete code, all they can do is make guesses based on vaguely similar problems they once had themselves. If you are a newbie, chances are you will dream up thousands of creative novel ways to write code that do not work. By refusing to post code, you are being as silly as a women who goes to the doctor for help and refuses to disrobe or take any tests and is angry when the doctor has no clue what the matter with her is.

When you post an error message, include the complete and exact text copy/pasted. It will mean far more to experienced people than to you. Since listings don’t have any line numbers, you need to manually indicate which lines error messages and stack traces point to.

Some people have taken offense at my advice and counter I can post any damn question I want, any way I want. I don’t have to follow your prissy power-trippy rules! That is quite correct, you don’t; it is just your odds of getting good responses are better if you follow this advice. Consider that some posts on the newsgroups attract the most experienced people who debate among themselves the optimal solution. Other posts are ignored or attract only a few not very helpful responses. Some questions get few responses simply because they are too difficult. Others do poorly for lack of following the advice above or for ignoring the additional advice I give in the newsgroups entry. It is your choice. If you want better responses to your questions, this is what in my experience, both as questioner and answerer, will get them for you.

In the process of creating the SSCCE, you often strip out the thing that is causing the trouble. 90% of solving a problem is knowing precisely what is broken.

Posting An SSCCE

Once you have your SSCCE you can post it to a newsgroup. Unfortunately, your newsreader (or the newsreaders of those reading your SSCCE ) may break lines at odd points. Or the file may simply still be a bit too fat to post. You can then post it on your website (plain or zipped) and post its URL (Uniform Resource Locator) or post your SSCCE on Google docs and post the URL on the newsgroup. You can also post your code snippet on Pastebin or in a GitHub repository or even my website mindprod.com. Just email me your snippet and I will post it using JDisplay .

Since the acronym SSCCE is used only on newsgroups, you are free to pronounce it to yourself any way you please. I suggest sskkee, a long hissing s, stuttered k, then ee as in tree. Some suggest ess ess cee cee ee. click to listen

Sending An SSCCE

When you send someone an SSCCE by email, don’t just embed it in the text of the message. The lines will wrap and it won’t compile. Further, there is a good chance you will forget to send everything, e.g. the imports. Send it as:


This page is posted
on the web at:

http://mindprod.com/jgloss/sscce.html

Optional Replicator mirror
of mindprod.com
on local hard disk J:

J:\mindprod\jgloss\sscce.html
Canadian Mind Products
Please the feedback from other visitors, or your own feedback about the site.
Contact Roedy. Please feel free to link to this page without explicit permission.

IP:[65.110.21.43]
Your face IP:[3.143.218.146]
You are visitor number