19

Take a look at C# get the name of a method that called another one [duplicate]. It was closed with 4 suggested links. The youngest of those is 8 years old. The obvious answers (accepted or highly voted) all point out that the way to do what the OP is asking is to walk up the stack using the facilities in System.Diagnostics.

In the second of those suggested links, the accepted answer (429 votes) includes this note at the end:

UPDATE Two years later since I'm still getting upvotes on this

In .Net 4.5 there is now a much easier way to do this. You can take advantage of the CallerMemberNameAttribute

In a couple of the other questions, there are later answers that point out that CallerMemberNameAttribute is the way to go. But they generally are getting single digit votes - the kind of answers that tend to be ignored.

The question I'm referring to is closed. I added comments pointing out the modern way to do this. How should this be handled?

Update (after reading the comments and the answer)

Perhaps the solution is to add a box (similar to the closed box) that says something like:

A Newer Answer May Suit Your Needs Better

Since this question was asked and answered, the underlying technology has been changed/advanced. Consider these answers as well as those posted below.

In the case of the example I show above, the original answers may be appropriate for some users. For most, I suspect the more modern approach is a better solution. This would need to be presented as an either/or, not as a "deprecated" thing.

Of course, the problem is "how to manage this". Perhaps with rules similar to close voting. I'm not sure.

15
  • When you think the newer answers are useful, then upvote them. Also: Introducing Outdated Answers project. There is nothing else to do apart from that upvoting newer (and good) answers. The question still is a dupe and OP can find their searched answer in the linked question.
    – Tom
    Commented Mar 12, 2021 at 16:56
  • 1
    With so many dupe links I tend to put a link to the most relevant answer(s) in the comments, that at least gives somewhat of a guidance as to where to look in the mountain of misinformation. Besides that... yeah not much to be done I'm afraid. my personal opinion is that the duplicate closures here are a little excessive.
    – Gimby
    Commented Mar 12, 2021 at 16:57
  • 7
    My frustration is that this closed as a duplicate this morning. Anyone quickly clicking through the suggested dup links will get the wrong (/outdated) information. Is there any process to get the dup links changed to something a little more up-to-date (I'm pretty sure this question is a dup - but the pointing to the correct/modern response would be a much better way of handling this)
    – Flydog57
    Commented Mar 12, 2021 at 17:02
  • 7
    I'm the one who closed the question and added all the dupes. I just didn't know about the more recent solution. :-/ I hope the Outdated Answers Project helps with this.
    – user47589
    Commented Mar 12, 2021 at 22:22
  • Does this then require two relevant gold badge holders to open and edit and close again or a single mod?
    – QHarr
    Commented Mar 13, 2021 at 7:00
  • @QHarr: if you have a gold badge, you can just edit the dup list these days. :) Or you can reopen and then close, if you haven't previously done either of those things to this question, but don't do that. Commented Mar 13, 2021 at 7:37
  • @PeterCordes Sorry. I meant if the original gold badge holder re-opened to edit then only a different holder could vtc again. Hadn't thought about the fact a different holder could edit then re-open.
    – QHarr
    Commented Mar 13, 2021 at 7:46
  • 2
    @QHarr: I see, well the key point is that you don't need to reopen to edit the duplicate list, as a gold-badge holder. You just click "edit" next to the list, and can do that any number of times to add and/or subtract links from the list. Very nice feature SO added in the last few years. You have a few gold tag badges yourself, try out the UI on a dup-closed question in one of those tags. (It has a cancel button to get out of it without bumping the question's edit time.) Commented Mar 13, 2021 at 7:53
  • 2
    Merge all questions to the one with up-to-date top answer.
    – Braiam
    Commented Mar 14, 2021 at 12:24
  • I've seen this before, I thought of making a meta topic about this question, I was about to post my code as an answer to it, using a more up to date (and much faster) option, but by the time I had it typed up it got closed as a dupe of a older, worse method, and that dupe was also closed. If I follow the linked list all the way to the end, the final dupe target says "how do I do (the outdated method)" which I can't answer with the better option (it'd be NAA). The outdated method is no longer a good solution for the OP's problem.
    – jrh
    Commented Mar 14, 2021 at 15:08
  • The only recourse I had was to do foreach(question trying to do what the OP is trying to do in duplicate linked list) { comment("Don't use the inefficient method, you can do X instead")}, but the giant signposts in SO itself will lead readers down the wrong path, sadly. Also, I'm pretty sure the duped questions aren't just outdated, I'm pretty sure the solution was never optimal for Q[0] and Q[1] in the dupe chain, I'm pretty sure tuples had indexed access from day 1.
    – jrh
    Commented Mar 14, 2021 at 15:10
  • 1
    What's even the point to link all the other duplicates? Isn't one link enough?
    – GG.
    Commented Mar 14, 2021 at 18:32
  • 4
    A long time ago, Joel Spolsky gave a talk in which he pointed out that one of the ways StackOverflow aims to be different than discussion boards is to keep all posts alive so that they don't become stale. I wonder if preventing new answers on closed questions while leaving old answers visible frustrates this goal. Maybe it would make more sense to either allow new answers, or delete/hide all existing answers.
    – Owen
    Commented Mar 15, 2021 at 3:13
  • 1
    @Owen for the most part, Google doesn't give a crap for the new answers which makes them virtually useless for the purpose. Of course old answers must be updated, but we need another site for that. SO is too old and bureaucratic for such a change Commented Mar 15, 2021 at 11:34
  • I re-read my earlier comment and after the fact I realise that I was my classically ambiguous self. "my personal opinion is that the duplicate closures here are a little excessive" -> I meant on the linked question specifically, not Stack Overflow in general. Dupe closing is fine most of the time.
    – Gimby
    Commented Mar 16, 2021 at 14:17

1 Answer 1

1

It's a very good question.

In general, when we close a question as already answered, we require that the duplicate target question actually delivers useful answers. Unfortunately, in this case the question is about a topic that was advanced in the meantime and it's likely that newer questions are about newer versions of the used software/language while the duplicate targets are more likely to deal with older versions but may also mix in results for newer versions. Basically this question here and the duplicate targets are a very good example of what a mess can become of a once clearly defined question over time.

The outdated answers project has just started but this feels like a prime example of it. Whatever will be the solution in the end, it feels like versions will be a main factor. There is no way around versions or we will end up in a mix of content valid for various software versions possibly without the information what version is actually used. That will result in lower quality of the offered knowledge over time. However, software versions by themselves are no simple thing to implement. That will require a carefully adjusted approach to get it right.

Until then and in this case, simply edit the top voted answers and clearly mark the versions for which an information is valid or specialize a newer question to only ask about a specific version of the software (say .Net 4.5 and larger) and then try to establish that as new canonical for modern versions.

In general, people should be careful when closing new questions as duplicates of very old questions and check that the old question doesn't contain only outdated content. As experts in their tags, they should know.

3
  • No need for versions, just merge all answers into one question.
    – Braiam
    Commented Mar 15, 2021 at 16:23
  • @Braiam But the highest scoring answer of them is outdated. It would not sort the most up-to-date one at top. We would still need to edit it. Commented Mar 15, 2021 at 21:08
  • It's still getting upvotes and only 3 downvotes, so people seems to see nothing wrong with it. If you merge it to a question with no accepted answer, they will sort themselves out with time.
    – Braiam
    Commented Mar 15, 2021 at 23:05

You must log in to answer this question.

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