-16

Today, I added a couple of tags, and to the question, SimpleDateFormat and TimeZone format to make it easier for someone searching for this type of question using these tags. A couple of minutes later, a veteran contributor commented on my answer on this page:

Just because you post an answer using java.time (which I think is appropriate, we hsould push towards using modern APIs) doesn't mean the question is related to java.time. I've undone the re-tagging.

Before posting this question, I went through What are tags, and how should I use them? to validate my understanding about tagging and it looks like adding those tags aligns with the purpose mentioned there. On the other hand, since this veteran contributor has 10 more years of experience on this platform than I have, it makes me confused regarding the concept of tagging. Therefore, my question is not regarding the justification of his feedback and action; rather, I want to understand it for the future. In other words, the question is not whether his feedback and action were right or wrong; rather it is regarding whether what I did (i.e. tagging the question with the relevant tags) was the right thing to do or I should not do it again.

7
  • 11
    The OP isn't asking about java.time so the tags shouldn't include it. The tags are for what the OP is asking about, not what the answers use as the solution. If the OP had specifically said that they wanted to use java.time, then sure, add the tag.
    – Thom A
    May 12, 2021 at 21:12
  • 1
    @Larnu - Many times, the OP does not know about the relevant tags or sometimes they even forget to add the right tag. Should we not add/correct the right tags in such cases?
    – anon
    May 12, 2021 at 21:13
  • 17
    Doesn't matter. There will be other methods that don't use java.time I am sure, and you tagging java.time invalidates those options. Again, correct the tags for the question, not the answer (you have provided). For example, this answer doesn't use java.time; you tagging java.time means the answer is incorrect as it doesn't.
    – Thom A
    May 12, 2021 at 21:15
  • 1
    @Larnu - So, what happens when we add newer API to the canonical questions/answers? Don't we add new tags (related to the newer API) to them?
    – anon
    May 12, 2021 at 21:17
  • 8
    Then you post a new answer, @ArvindKumarAvinash . That has nothing to do with the tags. You should most certainly not be adding a tag to a question posted 10 years ago because in 2020 a new API was created which does what the OP wants flawlessly. Again, tag for the question, not the answer.
    – Thom A
    May 12, 2021 at 21:18
  • 2
    There's a reject reason for that kind of edit: Adds irrelevant tags. Tags should define the question's content, not what the question actually includes.
    – 10 Rep
    May 12, 2021 at 22:22
  • why ask if you do ignore any answer/comment and still mark questions that are not about the java.time package with that tag? here another one : stackoverflow.com/questions/69759329/… Oct 29, 2021 at 7:42

1 Answer 1

26

To summarise my comments; no don't add tags to the question because of the method you (or another user) used in the answer. The tags are for what the question is asking about, not what the users used in their answer, or what the accepted solution uses.

In this example, if the OP tagged that means that they are looking for an answer using java.time. If, however, the OP hasn't tagged it and you post an answer that uses java.time, adding that tag to the question says to other users (who are yet to answer) that the OP wants to use java.time; that simply isn't true. If there are also other answers on the question, that don't use java.time then you are effectively invalidating them too; as according to the tags the answer isn't using the right method.

If, however, the OP had clearly demonstrated that they had tried (and failed) to implement java.time, then tagging it would be the correct path.