84

There is a question: How to prevent form from being submitted?. It has been asked more than five years ago and a lot changed since then. Basically, all the answers recommends using obsolete inline events (onsubmit HTML attribute) or assigning event handler to onsubmit property of DOM element, which is also not a good idea. I think these answers are bad, so I downvoted them, explained my point in comments (some of them has already been deleted) and posted my own answer.

After a few hours, the author of the highest-scoring answer noticed that his answer is obsolete. However, instead of writing his own solution, he literally copy-pasted the code from my answer to his own, without even giving me any credit. Also, he posted this code as third solution, so most of the users would still read only the first or second solution. I appreciate that he wanted to improve his answer, but I think that:

  1. He should write his own code, and possibly give me some credit.
  2. He should replace the outdated answer with an up-to-date solution, not add it as an alternative.

What should be done with it?

I think fixing this question is a priority, because it has over 100k views and still a lot of people come there and learn bad coding practices (which also leads to asking new questions containing code following these coding practices).

Edit:

The edit on this answer has been rolled back and it also has been made CW, so the problem with stealing my answer has been solved. However, I think that there still is a problem with this answer being obsolete. Actually, I'm not sure if calling it "obsolete" is appropriate, because it has been wrong at the moment of posting it, due to wide browser support of .addEventListener(). I think that it received so many upvotes because in that time nobody cared about code quality. If you have any doubts, I explained broader why .addEventListener() is the best way to register event handlers in another answer.

Related:

29
  • 15
    "After some time" was only a few hours. You could have tried commenting to the answerer. Commented Jan 26, 2016 at 0:17
  • 5
    @BillWoodger I doubt that it would help. Commented Jan 26, 2016 at 0:19
  • 51
    You can doubt all you like. If you had tried, you'd know. Of course, if you'd waded into a comment with "code stolen" it would increase the chance of you being correct without trying. Anyway, we're still left with the highly-upvoted answer, and I'd guess we're stuck with that for a while. Commented Jan 26, 2016 at 0:33
  • 11
    if only the admin on stackoverflow did not delete the comments in there.. you will see how annoying he was.. as if he wants to change the accepted answer to his. But the question is already years old. There are a lot who added some answers and got upvoted. but they were not as annoying as he is. (my opinion). So I just copied his answer cause I thought he could not edit my answer and want to correct what is wrong. BUT this figured, he just want to get the accepted answer. Commented Jan 26, 2016 at 1:28
  • 20
    @Reigel Is there a reason you marked the post as protected about 45 minutes ago? Preventing competing answers is not a legitimate reason. Commented Jan 26, 2016 at 2:23
  • 5
    @ThisSuitIsBlackNot that was just to prevent spam. I don't intend on competing... as what it says "This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site." Commented Jan 26, 2016 at 2:38
  • 13
    @Reigel I see a single answer (deleted, 10k only) that would fall into that category (it looks like it should have been a comment). One answer in five and a half years is not enough to warrant protecting the question. See "When should I protect or unprotect a question?" in the FAQ on Meta.SE. Commented Jan 26, 2016 at 2:51
  • 4
    No offense, but how would you write such a solution any differently? Change the wording of the comment or omit the alert?
    – cimmanon
    Commented Jan 26, 2016 at 13:45
  • 2
    @cimmanon I wouldn't mind if he turned his answer into CW and replaced his solution with mine, instead of adding it as alternative. Commented Jan 26, 2016 at 14:16
  • 2
    @Gothdo Theoretically your solution is valid (i.e. not obsolete), but it's commonly considered a bad coding practice. That's not just my opinion, but lots of JavaScript programmers agree with that. mixed messages man. Is it or isn't obsolete?
    – Just Do It
    Commented Jan 26, 2016 at 17:10
  • 15
    it's not good to downvote outdated answers, there should be other option, like mark it as outdated, etc. Commented Jan 26, 2016 at 18:41
  • 7
    @GiorgiMoniava When I hover over the downvote button, I see explanation what downvotes should be used for: "This answer is not useful". Are outdated answer useful? No. Even worse, they can often cause harm. So I downvote them. I may retract my downvote if the answer is edited to be up-to-date. Commented Jan 26, 2016 at 18:51
  • 7
    @Gothdo Ok that is a separate discussion probably no need to raise here, but downvoting is not fair to the person who gave a correct answer, albeit some time ago. Commented Jan 26, 2016 at 19:00
  • 3
    Related How do we encourage edits to obsolete/out of date answers?
    – Braiam
    Commented Jan 27, 2016 at 17:23
  • 2
    @WilliamK I wonder how is your problem connected to my question. Commented Jan 29, 2016 at 22:53

2 Answers 2

90

That's not ok; I rolled back the edit.

That said, it is possible that the user did this solely as a community service rather than for gaining points. Their answer is stuck to the top; they couldn't even delete it if they wanted, so they may have felt an obligation to keep the answer current. (The user doesn't appear to be in the habit of copying stuff from other answers, he looks like a solid contributor.)

Still, they have at the very least to provide proper attribution. Hitting the Community Wiki checkbox to prevent any further rep gain would also be a classy thing to do.

45
  • 53
    this still doesn't solve the problem that the top answer is obsolete yeah - that's kind of an unsolved problem on Stack Overflow in general
    – Pekka
    Commented Jan 26, 2016 at 0:15
  • 8
    @Pekka웃, just wondering, in this situation (not that I really care but), without "copy pasting" the answer, how would I update my answer to be more accurate to date? to make the answer accurate as much, the answer would be just the same as to Gothdo, so in general, how would someone do that? Cause it's like saying, we need a chair, but don't make a chair cause someone already did. :D Commented Jan 26, 2016 at 3:15
  • 25
    @Reigel Nobody said don't make a chair. They said don't steal someone else's chair and pretend you made it. You're required to cite material you get from other users. Not doing so is not only rude, but also a violation of the site's license. Commented Jan 26, 2016 at 3:30
  • 25
    @Reigel You're not listening. The copy/pasting is not the problem. The problem is that you didn't attribute where you copied from. Commented Jan 26, 2016 at 5:06
  • 57
    Sorry, that does not excuse you from giving credit where it's due. If you have a personal problem with the user whose answer you copied from, you are free to find another answer that you are happy to give credit to. Intentionally not crediting someone for their answer because you have a personal problem with them says a lot more about you than it does them.
    – BoltClock Mod
    Commented Jan 26, 2016 at 6:07
  • 9
    I'm not really good at explaining myself, so I will not say more... cause either way, I still copied it and that's a fact I can't not change... I just felt that the message/post of the OP is just one sided.. (moderator deleted all the comments there on the said Answer) that's why I tried defending myself. I realized, I don't have to. Just like how I ignored his comment but a moderator commenting my answer got my attention. Anyway, I just want to help. My rep is just a bonus from what I learned in helping... Thanks for the heads up guys.. Will not do it again. Commented Jan 26, 2016 at 8:57
  • 26
    Nice demonstration of the horrors of having to support an SO answer for the rest of your natural life. You have to be a damn fool to post answers in [javascript]. It has such a simple solution, write a new Q+A pair with the "modern" solution, vote as duplicate. Commented Jan 26, 2016 at 10:39
  • 25
    @Reigel simplest thing you could've done is add at the top of your post "update: attention: this answer is outdated. for an up-to-date answer see <<link>>".
    – Will Ness
    Commented Jan 26, 2016 at 13:30
  • 5
    @WillNess, I have thought about that... and then I realized, I don't have to... it's really the OP that says it is obsolete. But if you really know javascript, that is not obsolete.. There are ways to solve the said problem and I have given one of it. Whether it's best or not, it's still depends on one's opinion and the project/task to be accomplished. I've added there a link to an answer from another SO question that best describe it.. Commented Jan 26, 2016 at 13:46
  • 7
    @Reigel If you think so (that your answer is not obsolete), then why did you bother to copy paste that content into your answer..?
    – T J
    Commented Jan 26, 2016 at 14:22
  • 3
    An easy way to avoid conflict in such a case is to mark the post Community Wiki, to prevent any future rep gain.
    – Pekka
    Commented Jan 26, 2016 at 14:30
  • 12
    On my defense, I'm not really here on SO just to gain reps. I'm here to learn and help those who are also learning. I even rarely downvote. Try to check all my answers. Try to check all my comments. I do comments on answers which I think needs more build up. I suggest better answers if I have one(but not to the point that I'll push it to them). I communicate. That's how I think SO should be. Lots of COMMUNICATION. Not like this that you make a simple mistake, and then you're now the TURKEY on the table. I feel bad actually, I'm just trying not to care because it's not really what I'm here for. Commented Jan 26, 2016 at 14:43
  • 6
    @Reigel it is really simple. whenever you copy, you must give proper attribution. if you don't want to, don't copy, just give a link. Even if you re-write it, it is proper to mention where you got your initial inspiration.
    – Will Ness
    Commented Jan 26, 2016 at 16:00
  • 15
    @Reigel please try to bear with us:) You've made a mistake, and it happens to be of a kind that is very much frowned upon here (for good reason). Understandable that some people are furious (starting with OP here), but as Pekka said, you're a solid contributor to the site, and everyone makes mistakes. I believe essentially saying "Sorry everyone, won't happen again" (and then keeping yourself to that) is perfectly satisfactory in this situation, and it's the only thing you should be expected to do. That said, the CW is also a nice gesture and a display of good will. Commented Jan 26, 2016 at 18:55
  • 5
    @Hans then watch the +50 questions on Meta accusing you in public of "repwhoring" and of "disgraceful elitist behaviour" roll in. Yes, this happened to me. Yes, I am still bitter about it. Commented Jan 27, 2016 at 1:59
43

Frankly, it seems to me that dragging Meta into this just wasn't useful.

I agree 100% with Pekka 웃's reply that the author's actions weren't entirely acceptable. But please note: the only thing wrong was the lack of attribution. This may or may not have been an intentional oversight, but regardless it was a minor one and easily rectified.

When you post to Stack Overflow, you grant license to anyone else to copy what you posted. It is simply not even possible for anyone to literally "steal" what you wrote, even if we accept the (debatable) idea that copyright violations are even technically a form of theft in the first place.

Now that you got Meta involved, the Q&A there is IMHO a mess, or at least messier than it really needed to be. You have the minimum 2000 reputation required to edit posts, so you could have solved the problem yourself, simply by adding the necessary attribution to make the copied code legal and ethical.

Had you done that, then the top-voted, accepted answer would itself include everything a person needed, in one place, to understand their options in solving that particular problem. And after all, that's the whole point here. To help other people. When possible, it is better to just fix the site in the furtherance of that goal, using the minimum collective effort possible (i.e. without engaging others at all, if you can).

In the future, please don't jump to conclusions and please don't ask the community to handle situations you are able to handle yourself. And please do remember that, properly attributed, whatever you post here is freely copy-able by anyone else.

14
  • 17
    I don't disagree that handling situations with the least possible amount of fuss is always the way to go, but 1:1 copypasta with the OP not giving an appropriate response arguably is a reason to get Meta, or mods involved. It's very hard not to interpret it as a hostile act, even though it probably wasn't meant that way.
    – Pekka
    Commented Jan 26, 2016 at 20:24
  • 2
    I generally agree, but you missed my second point: "He should replace the outdated answer with an up-to-date solution, not add it as an alternative.". I asked this question because of two things: 1) using my code without any attribution and 2) outdated answer. The first problem has been solved now, but the second not. Commented Jan 26, 2016 at 20:25
  • If helping other people is the whole point here, then keeping answers up-to-date should be high priority. Commented Jan 26, 2016 at 20:28
  • 3
    @Pekka: "It's very hard not to interpret it as a hostile act, even though it probably wasn't meant that way" -- that statement seems self-contradictory to me. If something probably wasn't meant that way, then how hard really is it to interpret it as something other than a hostile act? It seems to me that the mere probability of it not being hostile is in fact strongly providing a way to interpret as something else. If the author rolled back the proposed edit, i.e. actively work against attribution, then it would be worth getting a mod involved (but still not Meta). Commented Jan 26, 2016 at 20:29
  • 1
    @Gothdo: "He should replace the outdated answer" -- frankly, on that we will have to agree to disagree. IMHO there is always a benefit to preserving what some might feel is an "outdated answer", as long as it's understandable as such. Not everyone will be using the latest (or even a very recent) version of the API and older answers are useful for that as well as historical perspective. "keeping answers up-to-date should be high priority" -- nothing the other person did precludes that. Commented Jan 26, 2016 at 20:31
  • 3
    On the same post, even with attribution, other users shouldn't be copy pasting content. This answer is dangerous.
    – Travis J
    Commented Jan 26, 2016 at 20:36
  • 5
    @Travis: "users shouldn't be copy pasting content" -- cite, please. Something more than your own personal opinion. Because the SO model clearly supports copying of content, broadly. Indeed, guidance to users trying to improve a Q&A is (when needed) consolidate various differing and poorly-presented answers into a single well-presented one, copying content as needed (with attribution). I see absolutely no reason at all to dissuade people from using the existing copyright license exactly as intended: to allow free, attributed copying of content. Commented Jan 26, 2016 at 20:43
  • @PeterDuniho No offense, but I think only someone with good JavaScript knowledge can judge if this answer is useful or not. My solution works in all, even obsolete browsers, excluding IE <= 8, which still supports proprietary .attachEvent() method. Actually, in the moment Reigel posted his answer, it already was bad and outdated, but in this time no one cared about code quality. It's absolutely no useful even for historical perspective. Commented Jan 26, 2016 at 20:48
  • 8
    @Gothdo: no offense taken. That said, while it is clearly your personal judgment that the answer was never of use, it is just as clear that a significant proportion of the community disagrees with that assessment. In any case, the question of the quality of a question or an answer is clearly outside the scope of the Meta site; it would be a waste of time and resources for anyone to post to Meta every time they saw a post incorrectly upvoted. Your recourse is to downvote and move on. That's it. Commented Jan 26, 2016 at 21:49
  • @PeterDuniho I realize that you are relatively new to meta, so it makes sense you need other people to do your research for you. re: your request for citation. The status quo is not "public domain"; attribution is already required. and also Stack Exchange does not claim exclusive ownership of content you submit. So no, the whole point is not some laissez faire help everyone goal. There are rules. Suggesting that we should bypass them because it is your personal opinion flies in the face of the ToS and ignores a very large historical discussion that you allude to not once in this answer
    – Travis J
    Commented Jan 28, 2016 at 22:05
  • @Travis: "I realize that you are relatively new to meta" -- you're funny. I found the rest of your comment similarly amusing, in its complete irrelevance to what I've written here. Please, feel free to put more words in my mouth; you're welcome to all the straw men you like...whatever floats your boat. Commented Jan 29, 2016 at 0:01
  • You really shouldn't laugh off the need for citation - that is after all the topic here. The disregard to historical precedence with regards to meta discussion and any sort of citation seems to have been used in your answer as well.
    – Travis J
    Commented Jan 29, 2016 at 0:09
  • "You really shouldn't laugh off the need for citation" -- I'm not doing that at all. Your claim that I am is hilarious. Please, do keep amusing me. Commented Jan 29, 2016 at 0:40
  • An alternative would have been that users vote the new and more uptodate answer eventually to the top. Now basically we have two identical answers (and the second but more upvoted answer refers to the other answer), so where is the sense in copying. I this were suggested behavior I could just add another answer to each question and copying and referencing the current top answer. This would not be helpful. That's the reason why copying answers is not very useful. (And also the rep gets assigned to the wrong person even giving credit.) Commented Feb 2, 2016 at 9:41

You must log in to answer this question.

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