"Jave Thare" and Viidhya Kishore: please note what it says on the title page for Beginning Java:
Please don't ask for and please don't give such answers. It does more harm than good, giving somebody code which he never learns to understand. Also, if that is handed in as an assignment, it will attract a mark of 0 because of plagiarism.
We're all here to learn, so when responding to others, please focus on helping them discover their own solutions, instead of simply providing answers.
This topic is a spin-off topic from here...
Campbell, Maneesh and myself are all moderators here, It is our right (and our job) to edit your post to have it comply with our standards. As long as we are not changing the meaning of what you said, we are WELL within our rights to edit your post.
Yes, of course I have heard of learning by example, but I know learning by doing is better. I also know how easy it is to read code and not understand what it is doing.
I do not know whether this is to be handed to be marked, nor whether anybody marking it has a policy about commented code.
We have our policies; if you are on this website, you are here as a guest, to abide by our policies. We don't abide by yours.
If you came into our homes and we told you to take your shoes off, or not to smoke,because that is our policy, you would doubtless accede. The only difference here is that you and I are several thousand miles apart.
You had yourself told everybody not to post a solution. Another user offered a solution, but only after a delay, so it ought to have been obvious that we didn't want a solution posted.
fred rosenberger wrote:. . . we do ask that people DontBeACodeMill and that you LetThemDoTheirOwnHomework. . . .
My bad. I once again claim the 'no coffee' defense. I have edited my post accordingly.
Campbell Ritchie wrote:It wasn't me who edited that post.
As you will have seen from this discussion, we have different opinions about what constitutes giving a straight answer and what doesn't. I might find a Rewriter solution acceptable, myself.
James Sabre in the "BJ" post this was split from wrote:Why would the solution need to be deleted? In the unlikely event that this is a homework assignment then it is probable that the use of 3rd party libraries will not be acceptable so the OP will have to do the work himself anyway. I want to encourage people to make use of existing technology and I feel that Rewriter needs more exposure. By waiting a couple of days I will have given the OP chance to find a solution with or without using Rewriter so he will have put in some effort. The chances are that the OP will not have used Rewriter (I have shown him the water but it is up to him to drink) but I believe that viewers of this thread will be best served by seeing how this problem can be solved using Rewriter. Hopefully then in the future they will be able to apply Rewriter to other problems.
In the case of thread 'Append another string at 150th location of current String' I see two possible scenarios. Either this is homework and the OP will be required to provide a solution that will not involve third party libraries/classes or it is a requirement for a company where the third party classes will be acceptable if the license is acceptable. I could not decide which of these scenarios applies. The topic seemed more advanced than that normally posted in the 'Beginning Java' forum but I still decided that it was too likely to be homework to risk posting even an example solution that was probably not going to be acceptable to examiners.
If 'Append another string at 150th location of current String' is homework then the OP will have had to submit his solution within a couple of days so what is the harm in then posting a solution based on Rewriter. The point is not really to post a solution to that particular problem but to post a solution that illustrated the possible use of Rewriter by relating it to that problem so that the reader may compare-and-contrast.
If this is unacceptable then I have a major problem with this site because I would view it as being over moderated. Even posting a short example that was not even a direct solutions to a particular problem would most definitely be a no-no because the example might be used by someone else as a homework solution.
Now, if the argument is that doing homework should be allowed, then I disagree. If the argument is what is homework, then there can be more than one answer. And I like the current solution; when anyone thinks it's homework, and wants to moderate, then fine. It's better to just play it safe, than to have endless discussions between moderators.
Henry Wong wrote:I actually can see a lot of gray area in this debate. How do you confirm that something is actually homework? How do you confirm that you crossed the line from helping to doing someone's homework? IMO, you probably can't. Probably not 100 percent.
Of course one can't tell 100% whether or not something is homework or not. I don't think anyone has said otherwise. I certainly haven't. A balance of probability decision is required.
Now, if the argument is that doing homework should be allowed, then I disagree.
I can't see anyone saying that doing homework should be allowed. To me that is an non-issue; of course it shouldn't be allowed.
If the argument is what is homework, then there can be more than one answer. And I like the current solution; when anyone thinks it's homework, and wants to moderate, then fine. It's better to just play it safe, than to have endless discussions between moderators.
Which is exactly what has happened except that there seem to be a disagreement as to whether or not some code be let through that uses a third party library that would almost certainly not be a valid solution if the thread was actually homework and almost certainly too late for the OP to use anyway.
Tomorrow I will publish the code based on the Rewriter class. If the moderators do decide to remove it then I hope they will provide better reasons for the action than have been provided so far. I hope the moderators will review the code before "playing safe".