122

One of the boring, recurring problems in the C and C++ ( and ) tags is the questions that get tagged with both languages when only one is appropriate. This is annoying to the cognoscenti who frequent the tags; it is one of the routine tasks to castigate people (mildly) for dual-tagging and then remove one of the tags — though it is sometimes difficult to tell which is the tag to remove.

However, it seems that part of the problem is that Stack Overflow encourages people to use both tags:

Just took the 3 suggested tags assuming the system knew better than I did.

No wonder we get so many dual-tagged questions! (The third tag in this question was .)

  • How can we stop SO from suggesting both the C and C++ tags?

I see the question Disallow the tagging of questions with both C and C++ tags in the related (and/or linked) questions section on the right. This is different. I'm not seeking to prevent both tags; there are occasions when both tags are correct, usually when asking about how C and C++ interwork. This question is asking that SO not encourage dual tagging — not that it prevent dual tagging.


Other tag pairs with a similar problem

Although the motivating pair of tags was C and C++, there are many other pairs of tags that should not normally be applied to a single question. Extracting information from comments (and adding a spare):

 

  • versus and other tags related to augmented or virtual reality (not a high volume problem, but another persistent one)

As I noted in a comment — lightly edited:

Can the code which suggests tags be tweaked so that there's a table of 'improbable dual tags' such that if two of the tags are listed in it and both are selected, then a pop-up occurs saying something like "It is usually not correct to use both [tag1] and [tag2] on a single question — are you sure you should use both"? Entries in the table would be made manually when such pairs are identified — maybe the tag wiki section would allow suitably privileged people to nominate and vote for such pairs.

This is similar to, but arguably simpler than, the currently top-voted answer by user0042, with which I mostly agree.

Cody Gray commented:

Making this more general seems like a pretty good idea, actually. Only thing I would change is make it a moderator-only privilege, rather than a gold tag badge privilege. It doesn't need to be something that people fight over or change frequently (and there is already way too much fighting over [c] and [c++] tags).

I'm happy to have the 'suitably privileged people' be diamond moderators, but I wonder whether the suggestions would scale appropriately. Would there be a MSO question raised for each proposed pair. Is that desirable? It probably depends on whether the number of pairs of tags is in the tens or if it moves into the hundreds or even thousands. At larger scales, the wholly manual mode seems unlikely to be appropriate. (As well as a mechanism to create 'inappropriate tag pairs', there'd need to be a mechanism to break such relations. Again, questions on MSO can be used, and there should be less call for breaking such relations, especially if they have to be reviewed, approved, activated by diamond moderators.)

I'm tempted to tag this as a feature request, or even as a bug!

29
  • 2
    I seem to recall this coming up once or twice before.
    – user4639281
    Commented Aug 19, 2017 at 4:06
  • 14
    I too would tag this as a bug. Commented Aug 19, 2017 at 8:17
  • 4
    When someone asks a question with something about pointers and dynamic memory, c and c++ are both pretty good guesses for appropriate tags and it makes sense that they are both suggested. We could remove one of them if the other was picked. Or maybe we could do something like "if post contains malloc suggest c otherwise suggest c++". If you want this to actually get done you will have to make a very compelling case that it is worth it, because I'm not seeing SO putting this high on their todo list.
    – nwp
    Commented Aug 19, 2017 at 8:49
  • 4
    By the way, why is SO software not on github so you can send a pull request? I thought this is how such things are supposed to work nowadays.
    – nwp
    Commented Aug 19, 2017 at 8:51
  • 2
    What about those of us who prefer to write in C++ but have to put up with C libs, eg. to OS? Such interop needs both tags. Commented Aug 19, 2017 at 9:02
  • 6
    @nwp about 50 % of the newbie questions to c are also tagged c++, even though they're about C... 25 % of the c newbie questions are then C++ questions. Answering the question takes much longer when you need to ask the OP to ensure what the language being used actually is... Commented Aug 19, 2017 at 9:08
  • 1
    @AnttiHaapala Then the system says: "oh, why not add this too" - agree, totally wrong:( Commented Aug 19, 2017 at 9:20
  • 8
    @MartinJames I copied a C question without any C++ parts, or mentions thereto, and the suggested tags say: C C++. As a newbie afraid of doing anything wrong, that's what I'd do. It should do so that some of them are exclusive - after C is chosen, do not suggest C++ any more from the list. It could be added naturally. But I don't see why it should be suggested after C was chosen. Commented Aug 19, 2017 at 9:25
  • 11
    There are several other tag combinations that pop up quite frequently and (usually) do not make sense. I sometimes see questions taged with Java and Javascript. Other example is OpenGL and OpenGL-es. Or Android and OpenGL. I bet there are hundreds of other such examples.
    – BDL
    Commented Aug 19, 2017 at 10:54
  • 1
    Supposedly, the only way to manipulate what the system suggest is to modify the already tagged questions. So, if you want to have the system to suggest one tag, you need to edit all questions that are dual tagged.
    – Braiam
    Commented Aug 19, 2017 at 12:04
  • 2
    @Braiam Or maybe tweak the algorithm to address the issue in this particular case.
    – Ron
    Commented Aug 19, 2017 at 14:18
  • 2
    Can the tag suggesting code be tweaked so that there's a table of 'improbable dual tags' such that if two of the tags are listed in it and both are selected, then a pop-up occurs saying something like "It is usually not correct to use both tag1 and tag2 on a single question — are you sure you should use both"? Entries in the table would be made manually when such pairs are identified — maybe the tag wiki section would allow suitably privileged people to nominate and vote for such pairs. Commented Aug 19, 2017 at 14:22
  • 1
    It could be rather simple with the counter-indicated tags. Just render the suggested tags as [c] or [c++]; [pointers], [undefined-behaviour] User chooses one of the counter-indicated tags - remove the others from the view. They can still add them by hand. It is less of a trouble to add tags than to figure out whether the OP actually meant [c] or [c++]. Commented Aug 19, 2017 at 19:44
  • 1
    Related (and very frequent and annoying): meta.stackoverflow.com/questions/304143/…
    – DavidG
    Commented Aug 20, 2017 at 11:09
  • 1
    Having asked a question that I tagged (intentionally) as both c and c++ I would like a solution to the needless bashing of those of us that use both. I specifically asked for either a c or c++ solution and got blasted. Yes both languages are different but sometimes either can be used to solve a problem. The 2 can be linked together rather easily. If I asked for a solution using either python or c I probably wouldn't get the same vitriol.
    – Matt
    Commented Aug 21, 2017 at 14:23

3 Answers 3

94
  • How can we stop SO from suggesting both the C and C++ tags?

Since that's not a problem specific for the and tags (though a very prominent one), I'd like to propose the following feature:

  • For every tag allow those with appropriate privileges (e.g. tag gold badge, or even official site moderators triggered by Meta Stack Overflow requests2) to keep a list of "counter tags":

    About

    C++ is a general-purpose programming language. It was originally designed as an extension to C, and keeps a similar syntax, but is now a completely different language. Use this tag for questions about code (to be) compiled with a C++ compiler. Counter indicated tags: , Edit

    ...

  • If the OP tries to add one of these counter tags after choosing the main tag and save their question, a warning should pop up

    Warning!
    One or more of the tags you entered (matching , , ...) are likely not to be used in combination with . This could be an indication that your question might be

    • unclear
    • too broad
    • ... maybe more reasonings1

    Please read the related tag info-wikis to make sure this combination was intended by you.

    I'm sure Cancel

    May be even the I'm sure button shouldn't be enabled before the OP visited the relevant tag info wikis (from here).

  • That warning might disappear for users above a certain rep threshold (e.g same as the established user).


1)These could be kept as additional data for each particular counter tag.

2)Picked up from @Cody Gray's comment

25
  • 18
    This an interesting idea, although I believe that one should be conservative on what pairs are recorded, and limit the feature to cases where they are known to be problematic. As in, we should avoid the reasoning "while we're at it, let's also add d and c#, rust and go, haskell and swift, ... because we know that having these tags together is fishy."
    – E_net4
    Commented Aug 19, 2017 at 15:03
  • @E_net4 "while we're at it, ..." If such feature once is realized I could think about extensions, e.g. such like general counter tag matching patterns kept by site moderators.
    – user0042
    Commented Aug 19, 2017 at 15:24
  • 4
    Certainly a good idea. [access] for[ms-access] is a good candidate too, the warning in the tag description doesn't seem to cut it sometimes
    – Erik A
    Commented Aug 19, 2017 at 19:59
  • Seems like this might also make people less likely to ask code translation questions or the classic "I need to make a program, what language should I do it in?" stuff. Commented Aug 19, 2017 at 21:16
  • 12
    Another good candidate pair would be [sql-server] and [mysql]. Commented Aug 20, 2017 at 11:33
  • 21
    Making this more general seems like a pretty good idea, actually. Only thing I would change is make it a moderator-only privilege, rather than a gold tag badge privilege. It doesn't need to be something that people fight over or change frequently (and there is already way too much fighting over [c] and [c++] tags).
    – Cody Gray Mod
    Commented Aug 21, 2017 at 3:27
  • @user0042 I am not sure if a generic warning text will be effective in all cases. Sometimes it may be useful to point out the specific problem with a tag pair. If we go through with having it as a mod privilege, it might make sense to have a meta discussion regarding the warning content for every tag pair, before the changes are applied. Commented Aug 21, 2017 at 4:49
  • I think there are enough cases where a warning text is needed that this probably should go into tag wikis. Commented Aug 21, 2017 at 5:47
  • 2
    @CodyGray I agree that this should be a moderator tool. That being said, how would we suggest tag pairs such as C and C++ in this case? Should we create a post on Meta to draw attention to it? Commented Aug 21, 2017 at 11:32
  • 2
    Yes, via Meta, like everything else. It doesn't scale all that well, but it's what we have. @CoryKramer
    – Cody Gray Mod
    Commented Aug 21, 2017 at 11:34
  • 1
    Should be careful not to discourage questions around important differences - e.g. why things that look the same aren't behaving the same. This is likely to come up across [c]/[c++], [c++]/[c#]/[java], [sql-server]/[mysql]/[postgresql], [python-2]/[python-3], etc.
    – OrangeDog
    Commented Aug 21, 2017 at 11:34
  • 2
    @OrangeDog I think that is one of the rare cases when people actually should tag both languages, e.g. "why does this code snippet produce different results when compiled in C vs C++" but those cases are far fewer than people mistakenly using both tags when they only are asking about one language or the other. Commented Aug 21, 2017 at 11:37
  • @CoryKramer that's my point - the warning should not give the impression that these questions are not allowed
    – OrangeDog
    Commented Aug 21, 2017 at 11:38
  • 4
    Please, do that for [angular] / [angularjs] questions. It will save me a lot of time of editing.
    – Mistalis
    Commented Aug 21, 2017 at 11:43
  • 1
    Except user Gimmethecodezplz doesn't read any of the text and just clicks "I'm sure". And then when someone brings up the issue with them, they start an edit war (yes this happens from time to time). I don't think warnings solve anything.
    – Lundin
    Commented Aug 21, 2017 at 13:46
1

For the specific issue of C versus C++, we have now tried to solve it by adding tag usage policies and user moderation guidance:

Proposed update to C and C++ tag usage wikis

We did try a meta tag briefly Possible meta-tag: [c++-cstyle], as proposed in my now deleted answer to this question. But after re-consideration, we went with the above linked approach instead.

The changes are now live to and . This relies heavily on C and C++ gold badgers to enforce the policies. If it ends well, perhaps a similar system of user moderation can be used for other similarly problematic tags.

This doesn't however rule out the proposal by user0042. If such a feature would be implemented, there's now text from the tag wikis that could be used for displaying to the poster.

-8

You can not stop people from tagging things wrong. Simply because tags system required same learning as e.g. design. Some people do it better, some worse.

I don't think it's necessary to do something specifically for C and C++. The reasoning

This is annoying

is simply not enough. I am mostly interested in C# and there are often people who use other language tags (C, vb.net, java, java-script, etc.), simply because:

  • they know all of them and can use either;
  • they have no clues;
  • OR because maybe their question is regarding both (for e.g. pinvoke or marshaling).

Some cases with multiple tags are clear indicator of broad question, where doing anything with tags won't make it much less broad.

though it is sometimes difficult to tell which is the tag to remove

Mark question as unclear, post comment or post an "i understand it this way"-answer.

I don't like idea of @user0042 with counter tags, it will only fix second case (where guy have no clue). For any 10k+ rep user it takes just few clicks to change tags. Is this a real issue worth improvement? Nope.

2
  • 2
    Spamming multiple, completely unrelated language tags is probably a different problem. C and C++ are after all in many ways very similar languages. There are valid cases where both tags can be used.
    – Lundin
    Commented Aug 21, 2017 at 13:34
  • 1
    Try hanging around in the SQL Server/MySQL tags, these two get combined incorrectly all the time, it's almost like SO is trying to annoy us :)
    – DavidG
    Commented Aug 21, 2017 at 13:56

You must log in to answer this question.

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