4

I have recently came upon a homework question:

Implementation of Dijkstra's Algorithim

It is surely not a good question, I have referred the user to How do I ask and answer homework questions? and also tried to give some start help.

A fellow user voted/commented that this is a duplicate of another, probably also homework question:

Implementation of Dijkstra Algorithm In Java

Formally they are probably correct. But I do not think it is right to close homework questions as duplicates of other homework questions. From my point of view closing as duplicate breaks one of the main principles on homework questions: providing an answer that doesn't help a student learn is not in the student's own best interest.

I don't see how referring the student to someone else's homework would help them. It may even damage as it invites the student to copy-paste someone else's code without much understanding. Yes, ideally the student should ask about clear parts, but hey, does it ever happen?

I also think that homework questions are very individual. From my point of view, the best answer isn't a ready-to-use piece of code but rather guidance for the student so that they would be enabled to solve the task themselves. This is very individual, closing as duplicate won't achieve this.

18
  • 7
    The question should imho be closed as too broad. This is basically a request to write the code for him. There is no attempt to solve the problem themself. If is not even clear if the file reading part is the problem or the Dijkstra's Algorithm.
    – BDL
    Apr 17, 2018 at 11:18
  • 16
    I don't think we should treat a question differently just because the asker happens to be a student. That goes against the stated goal of SO which is to be a repository for Q&A that will benefit future visitors first and foremost.
    – ivarni
    Apr 17, 2018 at 11:33
  • 5
    You mentioned that "providing an answer that doesn't help a student learn is not in the student's own best interest", but do we have a specific homework policy on SO, other than "treat it the same as other questions; judge and answer as if it's not a homework"?
    – Andrew T.
    Apr 17, 2018 at 11:39
  • 1
    Both of those reasons are why I looked for a duplicate at all. There was little attempt to even try to pseudo code the algorithm from their textbook, there was no attempt to look for the same issue already asked and answered, and no apparent attempt to read up on the algorithm prior to implementation. From SO purposes, it's a duplicate, too broad, poor quality, you name it.
    – Stephan
    Apr 17, 2018 at 11:44
  • 1
    @BDL I have no problem with closing this question as too broad. I have actually voted to close it as too broad.
    – lexicore
    Apr 17, 2018 at 11:47
  • 4
    @AndrewT. I think we do. Quote from How do I ask and answer homework questions?: Providing an answer that doesn't help a student learn is not in the student's own best interest. Therefore you might choose to treat homework questions differently than other questions.
    – lexicore
    Apr 17, 2018 at 11:48
  • 2
    @lexicore: As far as I understood this sentence, it only applies to writing answers to such questions. (e.g., don't post a code-only answer with the solution). It does, in my opinion, not apply to moderation things like duplicate closing. If there is an answer to the question somewhere else already, answering the homework question just to have a student/learner friendly answer is not optimal.
    – BDL
    Apr 17, 2018 at 11:51
  • @BDL I don't want to sound pedantic but treat is broader than answer. Closing as duplicate is also a way of answering on my book.
    – lexicore
    Apr 17, 2018 at 11:53
  • @BDL I also don't think that (at least in this particular case) it is really a duplicate. These two students actually have different problems. One is "I don't even know where to start", the other one is "there's a mistake in my code that I can't find".
    – lexicore
    Apr 17, 2018 at 11:55
  • 2
  • 1
    As I said, this is how I interpret the paragraph and how I think it should be handled. There might be other opinions on that, but we'll see how it turns out. I tried to keep my response here as general as possible because I think the example question shouldn't be answered at all because it's too broad. Thus I don't think that discussing the general matter on that specific question would lead to anything useful.
    – BDL
    Apr 17, 2018 at 11:58
  • I'm not sure treating a post written in 2008 as the final authority on how to deal with these questions is a great idea but you're obviously free to quote it as much as you want :)
    – ivarni
    Apr 17, 2018 at 12:15
  • 3
    @lexicore SO does not exist to be a personalized tutoring service in which individuals are tutored, creating posts that are of no use to anyone else. It's a place to create canonical sources of information that become a resource to the programming community as a whole
    – Servy
    Apr 17, 2018 at 13:30
  • 1
    Why not both? First we close as dupe, then you give a full course as an answer on the dupe target. I mean this question should be close no matter what. And you have a target where anyone can write a new way/ approach/ answer. So Close as dupe is already a Win-win. Apr 17, 2018 at 13:34
  • 2
    Dupe target is a code review.. so A new answer can be welcom there too. Strating from scratch to end with a better solution with the thinks process and a blog post. I am pretty sure I can find good(more than 20 upvote) of a question with a clear issue where Lippert or Jon comes with a new way. but it's been a long time since a question has been so good that it ends in a blog post. Apr 17, 2018 at 13:46

3 Answers 3

16

I think the other two posts are good, but miss one of the main points.

You should treat homework questions like any other.

If there is a duplicate of a question, it should be marked as such.

providing an answer that doesn't help a student learn is not in the student's own best interest.

Stack Overflow is not a school. While I have sympathy for the students and will give every effort to help them understand the solution to their problem, the users should all be treated the same. It doesn't matter if the OP is a student or has spent the last 50 years as a rocket scientist. It is up to the student to learn their material, not the SO community to teach it to them. They can find limitless amounts of tutorials and other study material online.

I don't see how referring the student to someone else's homework would help them. It may even damage as it invites the student to copy-paste someone else's code without much understanding.

The student can already do this before they even ask their question to begin with. If they have already found a post with a similar question, then they should include that in their post and explain what wasn't clear in the other post. Again, this is no different than any other question.

12

I'll post a longer reasoning now that I'm off mobile.

When I review questions, I first check to see if the Asker put sufficient effort into the question to warrant the time to answer. Typically that means, for technical questions, that they have code that compiles and runs, with some sort of error or aberrant output. It should also indicate that the Asker has either done enough work, or sufficient research to be able to recognize a good answer when they see it.

In this case we have several problems.

  1. The Asker is asking for an implementation of Djikstra's aglorithm
  2. The Asker has provided insufficient code relevant to the question
  3. This exact homework problem has been posted here before

With regard to the first, there are many ways to implement the algorithm. Failure to specify which approach the Asker is attempting is sufficient to close as Too Broad, in its own right.

Both the first item and the second indicate that the Asker has not sufficiently attempted the problem to justify asking others for help. The code could easily be rewritten to be:

public ShortestPathFinderApp(String filename) {
    AdjacencyList adj = new AdjacencyList(filename); 
    adj.doMyHomeworkForMe();
    ...
}

The Asker did not provide any attempt at an implementation to the actual assignment.

Now before we move on to item 3, I want to elaborate on why in particular a failure to attempt does not warrant any sympathy from me for a "i dont know where to start" question.

I do have some sympathy for the Asker here, as I don't believe universities introduce Djikstra's algorithm in a very effective manner. There's a tendancy to toss it in with discussions of graph traversal algorithms, usually before the student has had any exposure to its use in routing tables through a networking class. This was probably the most mind bending algorithm for me in university.

I want to have sympathy for the Asker, I do. But that's no excuse for failure to do some legwork on the problem. Reading the Wiki, which contains pseudocode on the algorithm is an obvious first step. Making an attempt to translate that pseudocode to java is a second. Lexicore was right to point those out to the Asker in the comments to give them a chance to remediate these issues. Lastly, the Asker should check to see if the question has been asked before here. It has.

In a perfect world, the Asker would fix the broadness and get an answer. But then the question would be a duplicate "Djikstra's Algorithm in Java", thus my flag.

5
  • 1
    I can absolutely understand and follow your position. Formally you're right. It's just... not helpful.
    – lexicore
    Apr 17, 2018 at 13:28
  • 5
    Haha I know what you mean. We all want to help, or we wouldn't be here to answer questions in the first place :) But I think it's more help in the long run to encourage someone to dig deeper into solving the problem themselves, and we can help when they get stuck on a specific, than it is to spoon feed when they haven't proven much effort. I also would argue that pointing out its a duplicate, and linking relevant reading material IS helpful, both in teaching them how to use the site, and to self-help to solving their problems...even if it doesn't give them code they can turn in for a grade.
    – Stephan
    Apr 17, 2018 at 15:03
  • 2
    I don't think simply closing the question of duplicate without explaining anything or giving improvement hints really encourages to dig deeper.
    – lexicore
    Apr 17, 2018 at 15:50
  • 1
    That's a fair point. I should have said a little more beyond the flag in the auto-comment.
    – Stephan
    Apr 17, 2018 at 15:54
  • There being several ways to accomplish a task does not make the question too broad. How-To questions must be well-defined (in that it must be clear what the author is asking, with little to no room for interpretation) and reasonably-scoped (in that it has to be about one or two closely related things, not seven). It could be argued that the entire Dijkstra algorithm constitutes many loosely related things, but it could also be argued that it is one clearly defined thing.
    – user4639281
    Oct 28, 2018 at 17:01
6

The FAQ answer you quote offers good advice that leaves room for the individual judgement of potential answer authors. Ultimately, though, I believe the issue you point out can be distilled to this scenario: If a dozen equivalent homework questions are posted because half of some CS class has decided to bring their assignment here, should we close them as duplicates or give them individual answers? I say we should close them, as they are duplicates, and not treating them as such would amount to putting individual tutoring ahead of the overarching goal of maintaining a library of questions and answers.

2
  • What if they're not from the same class (like clearly in this case) or what if they demonstrate different level of understanding/readiness?
    – lexicore
    Apr 17, 2018 at 17:54
  • 3
    @lexicore "What if they're not from the same class" -- That is no object, as the questions might still be essentially the same regardless. "[What] if they demonstrate different level of understanding/readiness?" -- That might (i.e. no blanket rulings here) be enough to make them non-duplicates, as long as the OP makes this difference explicit in the question itself. (It is also worth mentioning that too low a level of readiness tends to make such questions too broad.)
    – duplode
    Apr 17, 2018 at 19:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .