Java Forum / First Aid / September 2005
Why no SSCCEs?
Roedy Green - 29 Sep 2005 09:18 GMT It has just dawned on me why people are so reluctant to post SSCCEs or snippets of code of any kind. I always thought was laziness or perhaps inability to narrow the problem down.
Imagine you were to have a code review by say James Gosling, Bill Joy and Joshua Bloch, on Internet TV. You would be scared to death.
That is likely what it feels like for newbies having their code dissected here.
People seem to take criticism from a compiler without shame. They may feel frustrated, but rarely embarrassed. Part of learning quickly is to be willing to let other people look at your work. How else will you learn? The more you do it, the less your fear.
Very rare indeed is a piece of code that could not be improved in some way.
Perhaps we need to turn the tables every once in a while and have old timers post snippets and have the newbies have a crack at critiquing them.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Skip - 29 Sep 2005 09:43 GMT > It has just dawned on me why people are so reluctant to post SSCCEs or > snippets of code of any kind. I always thought was laziness or [quoted text clipped - 17 lines] > timers post snippets and have the newbies have a crack at critiquing > them. Most newbies come here for the first time with a basic question. They never heard of SSCCEs and tend to think that when they supply *any* code that will explain their problem.
Not much you can do about it, as they don't search for previous posts. Maybe the worst thing is that people actually read that massive code and try to point out (all) their bugs. It would be better when just a link was passed about SSCCEs, which often will cause them to find their bug, fix their code and live happily ever after.
Chris Smith - 29 Sep 2005 17:01 GMT > Not much you can do about it, as they don't search for previous posts. Maybe > the worst thing is that people actually read that massive code and try to > point out (all) their bugs. It would be better when just a link was passed > about SSCCEs, which often will cause them to find their bug, fix their code > and live happily ever after. Okay, I guess it's time to post my occasional plea asking people to not be a jerk. So here it is.
That's the most convoluted piece of logic I've seen in some time. Asking people to provide more information about their problem is fine. Please, go ahead. It's your time that you would spend reading the post and writing a helpful answer, and if you don't want to spend that time, you have every right not to do so. It's certainly even decent of you to *nicely* suggest that someone should provide more information.
Criticizing others for being helpful is just really screwed up. If new programmers coming to the newsgroup get answers to their questions, then the goals of the newsgroup are being achieved. The fundamental goal here is not to get people to post an "SSCCE", but to help them with problems they encounter in Java programming. If someone gets help but doesn't post an "SSCCE", then that's great!
Before anyone starts whining, I should say this. It's true that going through the exercise of creating a short piece of example code is very helpful in finding problems. I've suggested it to people on several occasions in the past, and Jon Skeet and I recommended it here well before Andrew made up his pretentious acronym for it. I'm not trying to convince anyone to stop making the recommendation.
It boils down to one basic question: are people who come here to ask questions human beings, worthy of respect and dignity? I think so. And I think the sentiment above treats them like dogs, to be trained into acting exactly as others desire. I think it's sick.
PLEASE, PLEASE, PLEASE just consider a few ideas:
1. If someone's post is lacking information, and you'd be willing to help them if they provide that information, then by all means ask for it.
2. If someone's post just pisses you off, then ignore it.
3. Tell people that putting together a simple example would be helpful; don't try to arrange for contrived consequences in order to force them into it.
4. If you aren't here to help people or to engage in interesting conversation, then please don't be here.
 Signature www.designacourse.com The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Skip - 29 Sep 2005 18:16 GMT > > Not much you can do about it, as they don't search for previous posts. Maybe > > the worst thing is that people actually read that massive code and try to [quoted text clipped - 11 lines] > you have every right not to do so. It's certainly even decent of you to > *nicely* suggest that someone should provide more information. I'm not saying helping that way is bad, I'm just saying helping that way is encouraging the behaviour. Everybody can decide for themselves whether they help one way or the other.
So why did I make that (appearantly bold?) statement? Posting fixes of giant parts of code normally doesn't help the OP understanding the true problem. He might just "fixy fixy" and running into a similair problem in a few days. When, however, he would boil the problem don't to a tiny piece of code, that encourages him to inspect, debug and fix, by understanding what happens.
I hope I clearified my previous post a bit, and I hope you agree.
Chris Smith - 29 Sep 2005 18:48 GMT > So why did I make that (appearantly bold?) statement? Posting fixes of giant > parts of code normally doesn't help the OP understanding the true problem. > He might just "fixy fixy" and running into a similair problem in a few days. I object to the premise. Sure, someone who gets a long detailed answer pointing out the problems in their code might just fix those problems and go on. That's not a bad thing. If they just have this one project to get done before returning to their main job of Delphi coding or system administration or whatever, then that may be exactly what that person needs. Someone who writes Java code as a primary job responsibility will eventually either give up and take up janitorial work instead, or come back ready for help on how to solve their own problems.
In either case, scolding someone or refusing to help because you feel its for their own good basically amounts to treating that person like a pet or a small child. It's insulting, and it's more likely to be upsetting than helpful.
Go ahead and suggest writing a simple example. Use Andrew's acronym if you desire. But please drop the condescending tone, and certainly don't criticize someone who has the time and inclination to be more helpful. Explaining problem solving skills is not mutually exclusive with helping to solve a specific problem.
(Not directed to you, but to a number of regular contributors to the newsgroup, not to be named... and mostly in hopes of heading off more people who seem to demonstrate a tendency to copycat similarly offensive attitudes.)
 Signature www.designacourse.com The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Monique Y. Mudama - 29 Sep 2005 19:15 GMT > In either case, scolding someone or refusing to help because you > feel its for their own good basically amounts to treating that > person like a pet or a small child. It's insulting, and it's more > likely to be upsetting than helpful. And it also wastes the time of regular readers, who have to wade through the mess of self-righteousness in order to find actual information.
 Signature monique
Ask smart questions, get good answers: http://www.catb.org/~esr/faqs/smart-questions.html
Skip - 29 Sep 2005 23:46 GMT <snip>
> In either case, scolding someone or refusing to help because you feel > its for their own good basically amounts to treating that person like a > pet or a small child. It's insulting, and it's more likely to be > upsetting than helpful. It's more like when somebody asks a vague question. Instead of finding out what they meant, with lots of possible erroneous assumptions, I ask "could you rephrase that?". That isn't insulting, or threating a person like a small child.
> Go ahead and suggest writing a simple example. Use Andrew's acronym if > you desire. But please drop the condescending tone I'm getting more irritated by your tone here. Can't we just exchange opinions in a civil way? Thanks.
Chris Smith - 30 Sep 2005 05:05 GMT > I'm getting more irritated by your tone here. Can't we just exchange > opinions in a civil way? Thanks. Sorry if you're offended. My comments aren't directed at you, as I already said. I have no problems with any of your posts (and actually, I can't recall any of them off-hand). I do have problems with other people's posts, who seem to be following a radical version of the ideas you are expressing.
 Signature www.designacourse.com The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer MindIQ Corporation
Roedy Green - 30 Sep 2005 00:31 GMT >Everybody can decide for themselves whether they >help one way or the other. I think we have to be careful not to hand out the answers to class assignments. If you do that you are robbing the student of their chance to learn. On the other hand if somebody asks for the code to validate a schema, it is just polite to give a complete code snippet rather than demand they wander about in the JavaDocs looking through hundreds of irrelevant methods trying to find the magic combo of meaty ones, just because it would be good for their character.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Tor Iver Wilhelmsen - 29 Sep 2005 16:07 GMT > Perhaps we need to turn the tables every once in a while and have old > timers post snippets and have the newbies have a crack at critiquing > them. But one of the reasons for telling people to write a SSCCE is that when they do, they are more likely to discover the answer to their question themselves. That is also valuable.
Frances Del Rio - 29 Sep 2005 16:25 GMT >>Perhaps we need to turn the tables every once in a while and have old >>timers post snippets and have the newbies have a crack at critiquing [quoted text clipped - 3 lines] > when they do, they are more likely to discover the answer to their > question themselves. That is also valuable. true indeed... sometimes while I'm composing a post and trying to articulate problem I find my error or answer to my question...
:) Andrew Thompson - 30 Sep 2005 12:22 GMT >>> Perhaps we need to turn the tables every once in a while and have old >>> timers post snippets and have the newbies have a crack at critiquing [quoted text clipped - 7 lines] > articulate problem I find my error or answer to my question... > :)
:-) Darryl L. Pierce - 30 Sep 2005 12:51 GMT > true indeed... sometimes while I'm composing a post and trying to > articulate problem I find my error or answer to my question... > :) At my first programming job, that cropped up alot between us (there were six developers total). We would, when stumped, turn to the others (we sat in the same area) and start explaining the problem. Probably 7 our of 10 times during this process, the problem itself would jump out and we'd turn back and go, "never mind"... :)
 Signature Darryl L. Pierce <mcpierce@gmail.com> Homepage: http://mcpierce.multiply.com/ "Bury me next to my wife. Nothing too fancy..." - Ulysses S. Grant
Roedy Green - 30 Sep 2005 00:58 GMT >But one of the reasons for telling people to write a SSCCE is that >when they do, they are more likely to discover the answer to their >question themselves. That is also valuable. Obviously people won't in general write SSCCEs except those preparing to a submit a bug to Sun. So I think the key may be to back off to a less onerous request -- just to see some code. If the person feels attacked, or likely to be a attacked, they won't give it. Since so few people seem willing to post code, I assume most feel threatened.
I don't think of myself as scary. In person, even though I get more respect than I do on the net, I can't think of anyone who acts at all intimidated. I love newbies. I remember my own excitement at discovering computers, and though it is not quite the novelty now it was for me, I can feel their thrill of discovery and accomplishment by proxy.
I think to myself. This newbie could be the next Bill Joy.
I sometimes wonder why some people hang out in a newbie newsgroup if they don't enjoy helping newbies. I think some are here to haze fairly defenseless victims.
The newbies I consciously take strip off are the ones who have a overly strong sense of entitlement -- that the universe owes them an answer to their question, a precise spoon size feeding, no more, no less than desired. They chastise answerers trying to help for misinterpreting their vaguely formulated questions.
The others I am deliberately unkind to are the ones who play helpless, and put no effort at all into anything other that badgering others to do their assignments for them. This is SUCH a futile exercise for both student and helper. Why spend all that time and money then subvert the education process? They should have spend the dough on a trip around the world.
Oddly, I don't mind the really dense ones. If they are willing to keep plugging, so am I. They are all geniuses compared with the customers I have had over the years. I have seen time and time again how a slow student needs intensive care, then suddenly they catch fire and are off on their own dazzling everyone. I remember one time tutoring a D student in ionic chemistry. Eventually he GOT it, and aced the exam, getting the top mark in the grade. The school made him re-write the exam under supervision because they could not believe the change. Stupid people are primarily discouraged people who have given up trying because others have beaten them into thinking they can't make it.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Monique Y. Mudama - 30 Sep 2005 18:53 GMT > Stupid people are primarily discouraged people who have given up > trying because others have beaten them into thinking they can't make > it. This is an interesting idea, and one I'll try to keep in mind with frustrating people.
That being said, some people are truly not that bright, through no fault of their own. A friend of mine teaches junior high school. One of her students worked harder than anyone else, got after-school help, etc., but just couldn't get it.
IIRC she didn't qualify for special assistance because "She didn't have a learning disability, just an extremely low IQ."
And people wonder why teachers get so frustrated that they quit.
 Signature monique
Ask smart questions, get good answers: http://www.catb.org/~esr/faqs/smart-questions.html
Andrew Thompson - 30 Sep 2005 19:26 GMT > IIRC she didn't qualify for special assistance because "She didn't > have a learning disability, just an extremely low IQ." Doesn't 'an extremely low IQ' result in 'a learning disability'? Or is this simply a government(?) education/health department's way to cut costs by sticking to 'the letter of the definition'?
Monique Y. Mudama - 30 Sep 2005 19:49 GMT >> IIRC she didn't qualify for special assistance because "She didn't >> have a learning disability, just an extremely low IQ." > > Doesn't 'an extremely low IQ' result in 'a learning disability'? Or > is this simply a government(?) education/health department's way to > cut costs by sticking to 'the letter of the definition'? Apparently, in the eyes of whatever organization decides these things in the state or county or whatever has jurisdiction in which this girl lives, having an extremely low IQ is by definition not a learning disability.
Yes, it's awful. I don't really care *what* category someone is in, if they are genuinely trying to learn and can't do so, I think we as a society have some sort of responsibility to help them, even if they don't fit a particular label.
 Signature monique
Ask smart questions, get good answers: http://www.catb.org/~esr/faqs/smart-questions.html
Andrew Thompson - 30 Sep 2005 20:31 GMT ...
> Apparently, in the eyes of whatever organization decides these things > in the state or county or whatever has jurisdiction in which this girl [quoted text clipped - 5 lines] > society have some sort of responsibility to help them, even if they > don't fit a particular label. It is a pity that the citizens of the world fail to elect governments that are willing to pay more than lip service to the tenets of the U.D.o.H.R. To wit <http://www.physci.org/humanrt/humanrt.htm#26>.
Ulrich Hobelmann - 01 Oct 2005 00:45 GMT > It is a pity that the citizens of the world fail to elect > governments that are willing to pay more than lip service > to the tenets of the U.D.o.H.R. To wit > <http://www.physci.org/humanrt/humanrt.htm#26>. The problem IS the election. People shouldn't vote on these issues. Human rights should be something you could sue for if violated. If anybody does you any harm, they should be liable.
There was law without stable governments (even without any governments at all). Today there should be law (minus all the arbitrary crap that was added by elected governments under the influence of strongarm lobbying groups).
 Signature Do or do not. There is no try. Yoda
Roedy Green - 30 Sep 2005 22:25 GMT >Yes, it's awful. I don't really care *what* category someone is in, if >they are genuinely trying to learn and can't do so, I think we as a >society have some sort of responsibility to help them, even if they >don't fit a particular label. I think of my mother who had a very selective intelligence. There were machines she liked, e.g. sewing machines, whose intricacies never phased her, and other much simpler ones like the retracting roof on her convertible, or a digital alarm clock, that would throw her for a loop. I put it down to playing helpless to get others to do work. The first order of business in dealing with a "stupid" person is to get them to give up the advantages of being incompetent, to persuade them they really would be better off competent.
The second order of business is persuading them it is possible to make a dramatic leap in competence if they invest the effort. I often do it by telling stories of other people I have helped. Confidence in me becomes a Dumbo magic flying feather to give them confidence in themselves.
The third order of business is to give them permission to fail. This why teaching kids is so easy in comparison to adults. They have absolutely no fear of making mistakes. Adults are often terrified to try anything least they make a fool of themselves. In face to face teaching, I sometimes use a technique where it is impossible not to fail on the first try. I make students guess things they have little chance of knowing. I use this to crack the fear of experimenting to discover knowledge.
The technique blew up in my face once working with a group of women reentering the work force. They considered this so cruel they reported me to the government bureaucracy who was funding the training. I had asked one to hit "any key" picked an random to demonstrate that computers would not explode as they do on Star Trek if you hit the wrong key. She went tharn like a deer in the headlights. She refused on grounds I would not tell her "which" key to hit. Then she burst into tears. I was asking her to make an impossible decision, according to the complaint.
You can see a similar fear reflected in many of the questions posted here. What would happen if I... What are they so afraid of that stopped them from just doing it to find out?
A think a lot of this fear and inhibition comes from impatient parents who squash child curiosity in a desire to have some belongings left intact or from parents who are overly afraid their child will injure themselves.
My own parents were the exact opposite. Today, they would probably get in trouble for letting me play with power tools, gas mowers, soldering irons, electrical components etc long before I went to primary school.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Andrew Thompson - 30 Sep 2005 22:52 GMT > ...What would happen if I... What are they so afraid of that > stopped them from just doing it to find out? [quoted text clipped - 3 lines] > intact or from parents who are overly afraid their child will injure > themselves. Well, maybe that combined with..
del *.*
;-)
icmrn@netscape.net - 29 Sep 2005 19:39 GMT You know, I just went to your site to find out what a SSCE was, and came across the following text "How dare you waste other people's time staring at irrelevancies and then ask a favour of them. " and then later "You infuriate everyone if insert or remove typos in your transcription."
Well, first off, I think this is the kind of self-rightousness someone refered to below. Secondly, maybe THIS kind of crap is the reason you are looking for, as opposed to being "scared to death". Thirdly, by definition, typos are accidental, dude, so no ones infuriating anyone purposely. Fourthly, you answered a question I had about a week ago here - thanks. On the other hand, to understand your answer, you needed to be someone who wouldn't have asked the question in the first place. It was like you're trying to show how smart you are. And now you wonder about why no one is posting SSCCE's ? ok, whatever
Roedy Green - 30 Sep 2005 01:13 GMT >Secondly, maybe THIS kind of crap is the reason you are looking for, as >opposed to being "scared to death". I have rewritten the section. It has the same meaning just more gently stated. see http://mindprod.com/jgloss/sscce.html
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Oliver Wong - 29 Sep 2005 21:57 GMT > It has just dawned on me why people are so reluctant to post SSCCEs or > snippets of code of any kind. I always thought was laziness or [quoted text clipped - 5 lines] > That is likely what it feels like for newbies having their code > dissected here. I can't speak for everyone, but the main reason I don't post SSCCEs is laziness. I have a side project I'm working on; a role playing game. At one point in the development of the engine, I encountered a situation where the VM would just unexpectedly quit between the execution of two lines. No exceptions thrown, no calls to System.exit(), no multithreading or anything. I'm stepping through it in a debugger, and I see one line get executed, and when I tell the debugger to execute the next statement, the whole VM just exits. As such, I suspect this is a bug in the VM and not my code.
But the source code is about 100KB split over multiple files. And I'm just too lazy to reduce that to a 300 byte file that reproduces and demonstrates the problem.
I don't think shame or embarassment is a likely problem. If they really are ashamed of their code, they can post anonymously. A lot of the newbies are posting from Google Groups anyway. For the truly paranoid, they could make a throw-away Hotmail account, register a Google Group account and post their code, all from a public library or Internet cafe.
Then they could go home, and lurk the groups, silently reading the answers/corrections/whatever.
> Perhaps we need to turn the tables every once in a while and have old > timers post snippets and have the newbies have a crack at critiquing > them. I have nothing against this idea except, how would one decide that their code is interesting enough to be posted?
I suppose I'll give it a shot. Here's some code I wrote that converts a GNFA to a regular expression. It's ugly, but I don't expect any maintenance to be done on it ever, so I haven't bothered to fix it up any. Critique away. http://cvs.sourceforge.net/viewcvs.py/gnfa2re/DFAtoRegExp/src/org/noip/nebupooki ns/dfa2regexp/GNFA.java?view=markup
- Oliver
Roedy Green - 30 Sep 2005 01:15 GMT > I don't think shame or embarassment is a likely problem. If they really >are ashamed of their code, they can post anonymously. Does anonymity help? I think it is the criticism they dread. I have often wondered why people DON'T get stage fright using a newsreader or writing a letter to the editor.
 Signature Canadian Mind Products, Roedy Green. http://mindprod.com Again taking new Java programming contracts.
Thomas Hawtin - 30 Sep 2005 07:03 GMT > > I have often wondered why people DON'T get stage fright using a > newsreader or writing a letter to the editor. Why some people don't? I do. Well not for newsreaders any more, as I've posted so much rubbish.
Tom Hawtin
 Signature Unemployed English Java programmer http://jroller.com/page/tackline/
Andrew Thompson - 30 Sep 2005 13:16 GMT > I can't speak for everyone, but the main reason I don't post SSCCEs is > laziness. Odd you should say that. I assume you are talking about posting code *answers*, since I do not recall you asking any code related *questions*, right?
Although I myself have posted a number of code answers as SSCCE's, that is not really the point of -the- SSCCE.
Frances nailed it when he mentioned that preparing such examples sorted the problem on occasions. And, heck, even if it does not solve the problem, at least you have the concise demonstration of the problem that might be either fixed here when new eyes/more experienced eyes see it, or form the basis of a good bug report.
Also, I think it's important to remember that there a range of problems not well suited to creating the singular, self contained SSCCE as the page promotes it. These include.. - D/B access - most J2EE (e.g. most servlets require separate configuration in web.xml..) - JNI - RMI - code involving external Java packages, including JMF, the Java comms packages(?).. - ...
Traditionally these sorts of things were not areas likely to be broached by people new to Java or new to programming. With advanced IDE's providing (e.g.) 'wizard based web application creation', we seem to get ever more noobs working on complex applications, stumbling into the variety of Java groups asking how to solve basic problems for which an SSCCE is impractical or impossible.
I resist posting the link for such people since I think the subtler message of the SSCCE page will be lost on them. The -real- advantage of making an SSCCE usually only occurs to a person after they have used the process to solve the problem for themselves.
Perhaps that is another reason you do not see too many SSCCEs posted to the groups. Most of the people that prepare them, solve their own problem. (Perhaps)
Oliver Wong - 30 Sep 2005 15:50 GMT >> I can't speak for everyone, but the main reason I don't post SSCCEs >> is laziness. > > Odd you should say that. I assume you are talking about > posting code *answers*, since I do not recall you asking > any code related *questions*, right? No; Later on in the post, I talk about this role playing game project I was working on which had some strange bug which I couldn't... well... debug. If I weren't so lazy, I might have reduced that game to a page or two of Java code that demonstrates the bug.
The reason you never saw any code related question was because I believe it's futile for me to just say the following:
<futileRequest> For some reason, whenever I run this project, it quits unexpectedly. You can get the sourcecode from CVS at http://sourceforge.net/projects/jtbrpg
It's about 100Kb. Please fix the bug for me. </futileRequest>
If someone does fix it though, I'd be very happy.
- Oliver
Andrew Thompson - 30 Sep 2005 16:34 GMT ...
> If someone does fix it though, I'd be very happy. I think I'll wait for the SSCCE. ;-)
Free MagazinesGet these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...
|
|
|