27

It happens to me all the time: I am searching for an answer to a current question I have in my Swift 3 code. I find a useful answer, but it is written in Objective-C or earlier Swift versions.

After solving my issue and maybe up-voting the answer, I want to add the Swift 3 syntax. If I make it an independent answer, people blame me in the comments:

... this is not a new answer. Edit the accepted answer...

which makes sense in my opinion.

If I on the other hand edit the accepted answer, it gets multi rejections blaming:

This edit was intended to address the author of the post and makes no sense as an edit. It should have been written as an answer.

So what is the way to leaf Swift (3) syntax for followers :

a) Don't do it

b) Add answer

c) Edit accepted answer

3
  • 10
    You should never edit an answer that isn't yours to include new code you wrote.
    – JAL
    Commented Oct 20, 2016 at 14:29
  • 2
    Hey, welcome to Meta! Now that you know it exists, please ask questions about the site here, rather than on the main site.
    – Nic
    Commented Oct 20, 2016 at 14:37
  • 4
    Martin's comment was lost in the migration, but this is very related: Are new Swift answers on old Objective-C questions beneficial?
    – JAL
    Commented Oct 20, 2016 at 14:40

2 Answers 2

20

You should never be editing another user's answer and adding content that they didn't create that drastically changes their answer. This includes code they didn't write. We don't want to put words in another user's mouth. You can always add a comment on an accepted answer that the user's answer is outdated and needs to be updated.

Generally, unless the question is Objective-C specific, I'd say it is acceptable to add a new Swift answer to an old question. If you have an existing answer, you can always edit that to include both Objective-C, and other versions of Swift (2.x, 3.0).

8
  • 4
    Yes, absolutely. And if something wrong/subpar is added to an answer, the answer will be downvoted, and that would create a rather unfair situation for the original answerer. One should always post their own answers instead of adding code to others, so they can be held responsible for what they post (in a positive or negative way).
    – Eric Aya
    Commented Oct 20, 2016 at 15:05
  • @EricAya, just curious then, what's the point of allowing edits on answers if we should never do it? Commented Oct 21, 2016 at 0:53
  • @FighterJet please review the Help Center topic on editing: stackoverflow.com/help/editing
    – JAL
    Commented Oct 21, 2016 at 0:55
  • 2
    @FighterJet I'm not saying we should not edit answers. I'm saying we should not modify an answer in a way that would change how people can vote on the answer. So ok for fixing typos, grammar, improving phrasing, replacing an obsolete link, etc, maybe even a trivial syntax update if really it's straightforward and easy to spot, but that's the extend of it - anything of importance should be in its own post.
    – Eric Aya
    Commented Oct 21, 2016 at 8:02
  • 1
    "You should never be editing another user's answer" this is a contradiction with current guidance stackoverflow.com/help/editing
    – Braiam
    Commented Oct 21, 2016 at 12:51
  • @Braiam you're right, I edited my answer to address changing a substantial amount of someone else's post.
    – JAL
    Commented Oct 21, 2016 at 13:20
  • 3
    Somehow I dislike one highly upvoted answer for Swift 2.x and several newer answers with Swift 3.x solutions. I would prefer to add a new "Swift 3" section to the Swift 2 answer. The guidance says ...add updates as the post age. What I see as a problem is the editors who replace Swift 1 & Swift 2 answers with their own Swift 3 code without keeping the original.
    – Sulthan
    Commented Oct 21, 2016 at 16:06
  • So you prefer tens of answers, with multiple Swift versions, instead of a couple of ones (different implementations) with code blocks for each Swift version added by the community? Commented Apr 19, 2019 at 12:06
8

You have hit one of the most contradicting features of the site. While the help center says:

If you see something that needs improvement, click edit!

and then continues:

When should I edit posts?

[...]

  • To correct minor mistakes or add updates as the post ages

The edit privilege help page has something ubiquitous:

When should I edit posts?

Any time you feel you can make the post better, and are inclined to do so. Editing is encouraged!

Some common reasons to edit are:

[...]

  • to correct minor mistakes or add addendums / updates as the post ages

Basically, you are in the clear for updating the Swift answers. This has been noticed by SE staff without any conclusion.

9
  • 1
    I think there is a bit of confusion about the "add updates as the post ages" guideline. The guideline means that if the answer using "FrobPlus 3.0" is no longer quite correct for "FrobPlus 7.5", then edit the answer, add a caveat, include a workaround - "update it, as the post has aged". However, if in the meantime the new preferred technology for Frobbing is now "Frobotron.NET for LISP", you should add a completely new answer, maybe with a caveat to fend the nitpickers: "Since 2035, the preferred way to Frob is X. Here's how you can solve the same problem in X" Commented Oct 21, 2016 at 17:31
  • @EuroMicelli not sure what you are trying to say? I prefer people editing answers to keep the updated (specially on high profile questions) to grandfathering information that isn't useful anymore.
    – Braiam
    Commented Oct 21, 2016 at 17:41
  • 2
    It's possible that it's not useful to you. However, I guarantee you that there are plenty of people who need to know (say) how to do XYZ in Visual C++6, which was discontinued 16 years ago - and yet, there are real world business scenarios where it is in use today. Closer to the original question: it's not like everybody is using Swift and nobody can use Objective-C to write iOS apps anymore. In what sense is the Objective-C answer useless? Commented Oct 21, 2016 at 17:50
  • @EuroMicelli how is information lost? It's all there, in the revision history for anyone interested...
    – Braiam
    Commented Oct 21, 2016 at 18:09
  • 1
    The revision history is there for (essentially) auditing purposes. That stuff is not indexed by search engines and nobody is going to think "I wonder if an older version of this answer has the answer I actually need". The older-but-still-valid answers need to stay on the surface. Commented Oct 21, 2016 at 18:14
  • @EuroMicelli but will you risk not having the newest answer because you don't want obsolete information to be buried? I prefer having updated information over obsolete but still valid for rare cases any day. The 98% is more important
    – Braiam
    Commented Oct 21, 2016 at 23:01
  • So, you put the "newest answer" in a "new answer". Leave the "old answer obsolete-to-you-but-helpful-to-50%-of-others" alone. That is what I advocated for in my initial comment. Commented Oct 22, 2016 at 15:20
  • 1
    @EuroMicelli no, new answers rarely get exposure, and most of the time incremental improvements are desired and encouraged whenever "you can make the post better"
    – Braiam
    Commented Oct 24, 2016 at 4:12
  • @Euro Micelli: When editing an answer, I would add the Swift Syntax, so the Objective-C part is not lost and, in my opinion, the answer is enriched. It's just an added syntax. I would not change the semantic context of the answer. I as a SO user allways appreciate those kind of answers. Anyway, I still have the feeling that this topic is rather opinion based. I will not edit posts for so long to avoid shitstorms and being penalty blocked for SO functionality for too many rejected edits and such. Commented Oct 25, 2016 at 16:23

You must log in to answer this question.

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