32

In Why would one use %8.8 over %08 in a C or C++ format string?, the OP had tagged this with and . However, a user blasted into the comments section (now comments are deleted) and with his stubbornness, he managed to remove the tags, even if the majority of the people believed otherwise; I feel they stood back because that way was just too rough.

Should the post carry these two tags?

PS: since that user is too notorious for his behavior, but better late than never to act. I do not want to rollback the post myself without some discussion first, because I am afraid of him.

10
  • 12
    I don't mind that high-rep users are teasing each other with asking questions that could be tagged both C and C++ and then to see who bites. Not sure what the entertaining value on meta is.
    – rene
    Commented Jun 15, 2017 at 19:14
  • 1
    @rene to discuss whether the post should carry these tags or not.
    – gsamaras
    Commented Jun 15, 2017 at 19:15
  • 49
    who cares? Tag it C# and call it a day ...
    – rene
    Commented Jun 15, 2017 at 19:16
  • 17
    I really thought somebody edited that PS into your question...
    – Barry
    Commented Jun 15, 2017 at 20:38
  • 12
    c and c++ are both subsets of programming languages, so I think the question should be tagged programming-language to avoid conflicts. Commented Jun 16, 2017 at 4:32
  • 2
    For revision 1 I find it reasonable to remove the [c++]. However, the edits made by OP in revision 3 justifies both tags in my opinion. The final situation where there is neither a [c] tag nor a [c++] is in my opinion unfortunate. I would however not do any rollback now - the question has already been well answered so I don't think it's worth to continue the war for this question. Just move on.
    – 4386427
    Commented Jun 16, 2017 at 5:10
  • 6
    We can quibble all day about whether the [c] or [c++] tag is the best fit, but at the end of the day, it would be way better to have both language tags than to have none at all. The question really needs to be edited, but I guess it won't be me who hot-potatoes it, either.
    – Cody Gray Mod
    Commented Jun 16, 2017 at 10:18
  • 1
    @CodyGray I agree, will rollback the edit.
    – gsamaras
    Commented Jun 16, 2017 at 14:40
  • 18
    upvoted because I am afraid of him made me laugh Commented Jun 16, 2017 at 18:05
  • 1
    @gsamaras - all I will say about this is that it's been an interesting welcome back to SO after my hiatus. Thank you! Commented Jun 16, 2017 at 21:01

3 Answers 3

15

About the PS

I flagged the (first comment in the) comment chain with an 'Other' flag and said:

In this comment chain, there's a huge debate about C vs C++ vs C and C++ which is frankly not very constructive. Many of the comments below could be removed as 'not constructive'.

This was accepted as helpful. I'm guessing my flag is what triggered the clean-up; someone else could've done something similar. I've done similar flagging exercises before on occasion.

A key point to note is that my flag comment explains what needs to be done. Simply flagging one of the comments as 'not constructive' won't get the whole chain reviewed; the moderator will look at the one comment, decide what to do about it in isolation, and move on to the next item in their overloaded queue. Ditto for any other flag that doesn't take an explanation. If you think there's more than one comment to be processed, you must use 'other' and explain your thinking succinctly.

If (when) you see a similar set of competing rants in progress, you should do something similar — flag for moderator attention, explain the problem, and (having lighted the blue touch paper) stand well back and let the experts deal with the mess.

About dual-tagging questions with C and C++ tags

I'm not taking sides in the 'should this specific question carry both the and tags' — that's how comment wars break out. The question currently has neither language tag; that's not ideal but it is better than a war.

I stand by my original edit that removed the tag; at that time, the question made no reference to C++ and explicitly included C (only) in the title — it was a question about C and the tag (only) was appropriate. The OP then changed the question to refer to both languages and tagged it with both tags once more, launching the war.

In general, I prefer questions that are tagged with only one of the two languages, C or C++ but not both, unless the question is explicitly addressing the interworking of C and C++. It's a bit of a moot point whether this is asking about the interworking of C and C++ — I'd argue "No", but the OP gets some say in these issues (as does the community).

If a question is dual-tagged and has any feature in the code that is distinctively only C++ (#include <iostream>, using namespace std;, cout <<, or similar), then the C tag should be removed; it is about C++, not C. Common mistakes like: typedef struct Something { …; Something *next; } Something; are tricky — the code only compiles in C++ unless there was already a type Something defined (in which case, there are bigger problems to deal with). However, I'd not automatically say "it must be C++" because of this.

If the code is about the C-compatible subset of C++, I think the C++ tag should be removed (and that fits this question — I'd prefer it to be tagged with only C, with the question content about C++ removed). But there isn't much point in a huge fight about it. It's better to let others do the fighting and simply get on with the rest of your life. There are more important things to worry about than which combination of C and C++ tags is OK on a question.

9
  • 6
    This meta question is asking how the question should be tagged. Removing a relevant discussion about the how the question should be tagged is counterproductive to that goal, and not answering it. The meta post isn't here to say that the problem is comments on the post discussing how to tag it.
    – Servy
    Commented Jun 15, 2017 at 20:59
  • Just updated to address that…maybe not as helpfully. Commented Jun 15, 2017 at 21:00
  • 9
    Posting an answer to say, "I'm not going to take sides" doesn't really answer the question though. If you don't want to put forth an opinion then....don't post an answer, rather than posting an answer to say you don't have an answer.
    – Servy
    Commented Jun 15, 2017 at 21:01
  • 1
    @JonathanLeffler: "The OP then changed the question to refer to both languages, launching the war." You fired the first shot when you choose to edit the OP's post. You may not have engaged further in terms of editing, and someone else might have made the same edit you did. But you did in fact make the choice to get involved. Commented Jun 15, 2017 at 21:23
  • 10
    @NicolBolas: Yes, but I think my edit was justified at the time when I made it, for the reasons stated in my answer. When the OP changed the question to explicitly reference C++, I let it be. I didn't like it much, but I didn't get further involved in the issue. It isn't worth it. Commented Jun 15, 2017 at 21:25
  • 1
    I'm quite sure I saw a post somewhere saying that comment flags are grouped together, and that flagging non-constructive on each comment is a better option, as they appear together. It was recommended over 'other' since it allows mods to prioritize their flag handling. I can't seem to find that meta post, though.
    – Rob Mod
    Commented Jun 16, 2017 at 0:06
  • 2
    @Rob: Different meta posts by different mods over time have recommended contradictory things. It's not a pretty situation. I think the current advice is to go ahead and flag all comments individually in most cases. But before that it was to use Other unless there was only one or two comments to hit. Commented Jun 16, 2017 at 3:03
  • What is the abbreviation "PS"? Commented Jun 16, 2017 at 6:09
  • 1
    @PeterMortensen: 'PS' is short for 'post-scriptum' or 'post-script'; it means 'writing after the previous end of message'. See Wikipedia on Postscript for example. Commented Jun 16, 2017 at 6:26
38

One of the primary purposes of tagging a question is to make sure that domain experts who might know the answer will see it. This is why it is important that questions involving the C++ language don't arbitrarily get the C tag, and vice-versa. Domain experts for one language are often times not familiar with the idioms of the other. Even if a C++ programmer might be able to answer a pure-C question, odds are good that a C programmer will use better C idioms in their answer. And vice-versa.

However, the content of the question is the important thing. And the content of this question, on the nature of printf formatting, can be equally answered by C and C++ domain experts. C and C++ idioms will not affect the answer; the OP is looking for the behavior of a function which is identically defined in both languages.

As such, I would say that in this case it is not unreasonable to tag it with both languages. And therefore it is not reasonable to undo the tagging of the OP.

As a general rule, I would say that if a question is dual-tagged C and C++, you should remove one of the tags if:

  1. The question's content contains constructs that are unique to one of those languages, or otherwise references things that make it impossible for a pure domain expert for the other language to help.

  2. The question's content contains idioms that are predominantly used by one of the languages, which are either not available to the other or not in significant use by the other. This is more of a judgment call, as it requires knowledge of what idioms are in use by domain experts. I'd say that printf doesn't qualify here, because despite iostream existing, printf is still valid C++ code and is widely used in real C++ programs. And therefore, C++-only programmers are still perfectly capable of answering questions about it.

26
  • Why it has to be 2 or 1? Can't we just use the printf and be done with it?
    – Braiam
    Commented Jun 15, 2017 at 22:09
  • 27
    @Braiam [printf] has less followers than you have badges.
    – Siguza
    Commented Jun 15, 2017 at 23:33
  • 13
    @Braiam How many experts do you figure actually watch the printf tag for new questions? I'm willing to wager that the number is significantly less than the number of followers of that tag, on the order of none. Conversely, there are many experts watching both the C and C++ tags for new questions. I suppose if the goal is to not receive an answer, excluding the C and C++ tags would be a great idea.
    – user4639281
    Commented Jun 15, 2017 at 23:54
  • 6
    @Braiam I'm pretty sure you misinterpreted the passage you quoted. It says "might know the answer", not "are guaranteed to". Also, your conclusion is fundamentally flawed as can be shown with any tag with 0 followers. Let's take [phpexcel-1.8.0] as an example. Tagging the question at hand with that is very obviously wrong because it has absolutely nothing to do with either PHP or Excel. Yet, since the tag has an empty set of followers, that set can be proven to contain only experts for format specifiers.
    – Siguza
    Commented Jun 15, 2017 at 23:57
  • 7
    The key is striking a balance between reaching a sizeable audience and using tags as narrow as possible. By all means, give it the [printf] tag, but also give it at least one of [c] or [c++]. If you have an expert in C who is not also an expert in printf seeing a question tagged with [c][printf], that should be enough to put him off. I mean, that's why ignored tags exist, right?
    – Siguza
    Commented Jun 16, 2017 at 0:06
  • 5
    @Braiam Take [tabcapture] as a non-versioned example then. My points still hold. And yes, it would be great if exposure worked that reliably, but let's have a look at this question, shall we? At the time of my writing it has been here a day and it is tagged with [javascript] which has over 641'000 followers, yet it has gained a whopping 9 views. Point is, even 1000 followers are extremely unlikely to be enough to even get one to see your question.
    – Siguza
    Commented Jun 16, 2017 at 0:35
  • 12
    @Braiam who cares? Users who post questions with the intention of receiving answers care. At this point I can only surmise that you are trolling so I'm just going to stop here.
    – user4639281
    Commented Jun 16, 2017 at 0:54
  • 7
    @Braiam You're the one who made two mistakes just there, and you still completely missed my point and haven't provided any arguments against my other points.
    – Siguza
    Commented Jun 16, 2017 at 1:06
  • 13
    @Braiam: And yet, the person you're talking to has demonstrated how tags actually work on the site. It doesn't matter if you'd rather there be some pure expression of tags, where people follow every single tag that they know something about. The reality is that language and major API tags are how 90+% of people find the questions that they're interested in. Tags like printf are not. Therefore, the reality is that if you want to get your printf question answered, it needs an appropriate language tag. And having both C and C++ is appropriate, since both qualify. Commented Jun 16, 2017 at 1:39
  • 18
    @Braiam: "That people thinks of tags as hashtags and whatnot doesn't mean that we have to start using them as that." You say that as if tags have not always been used this way. Since day 1. People use tags to find questions to answer, and people do not use highly specific tags like printf to find questions to answer. That's reality. You can rail against it if you like; you can say that things would be better if we followed hundreds of tags instead of just a few. But these things aren't going to change. Commented Jun 16, 2017 at 2:33
  • 1
    @NicolBolas - Many good things in this answer. I'm not sure though that I find it OK to use dual tags when looking for the behavior of a function which is identically defined in both languages. That would mean that a question about an if statement, could be tagged with a lot of language tags and that it would be OK. I would find that a bit of a misuse.
    – 4386427
    Commented Jun 16, 2017 at 4:55
  • 5
    @4386427: The difference here is that printf is the same between the two languages; the C++ standard directly references the C standard for its behavior. By contrast, the C++ if statement is actually different from the C if statement. C++17 made sure of that when it added initializers to if. Again, it's about who has domain knowledge about the subject. For printf, both C and C++ programmers have knowledge about it. Commented Jun 16, 2017 at 13:11
  • 1
    I agree with most of this answer, but still arrive at a different conclusion. "the OP is looking for the behavior of a function which is identically defined in both languages." -- For a long time, it wasn't identically defined in both languages, and even now that they are, I wouldn't expect a C-only developer to know precisely which functions in the C standard library are unchanged in C++. Answering the question requires C++ knowledge.
    – user743382
    Commented Jun 17, 2017 at 6:40
  • 2
    @hvd say someone is looking for the same answer in a C context a year from now. If it doesn't have the C tag, they are much less likely to find it.
    – user4639281
    Commented Jun 17, 2017 at 15:27
  • 1
    @hvd that is nice in theory, but I don't see the "re-tagging them after they've been answered" idea taking off.
    – user4639281
    Commented Jun 17, 2017 at 16:53
3

There is lots of friction when both the and tags are used on the same question. Veterans of both languages are all deadly tired about clueless newbies tagging their questions with both tags thinking they program in the "C/C++" language. While veterans know that the languages have not been compatible since the early 90s, long before C++ was even standardized.

The only questions that need both tags are those addressing differences and compatibility/porting between the two languages. Therefore user moderators tend to want to fix this as quickly as possible by dropping one of the tags.

In this case it wasn't clear which language that was used. But since the question revolves heavily around printf, it is a pretty safe assumption to think that the question is about C. And more importantly for the purpose of tagging, those following would be the best suited to answer it.

However, the OP keeps insisting that C++ is relevant, even though nothing in the question indicates this. Strictly, it boils down to that they cannot compile the code as "C/C++", because on top of the file there has to either be a #include <stdio.h> or #include <cstdio> - C and C++ are not compatible when it comes to standard header inclusion. Other than that, C++ is completely irrelevant to the question. The two languages are completely equivalent when it comes to printf().

All posted answers are correctly given from a C perspective.

Summary:

  • The question is about a C standard library which C programmers are best suited to answer. Therefore it should be tagged C.

  • C++ is irrelevant to the question. The OP needs better justification for including it than "the code will also compile in C++". From what's noted in edit comments, the OP cannot give any rationale for why it should be tagged as C++.

    For the record, they could have done so by adding a full MCVE that would only compile in C++ and not in C. This was not done.

  • The question must be tagged with a language tag or nobody will be able to find it. The C tag shouldn't have been removed.

16
  • "The question must be tagged with a language tag or nobody will be able to find it" [citation needed]. People finds chrome extension, api, libraries questions to answer just fine. Not every question needs a language tag.
    – Braiam
    Commented Jun 16, 2017 at 23:29
  • 4
    To be fair, #include <stdio.h> is fine in C++. Insisting that #include <cstdio> be used instead is simply a preference. Both tags don't bother me when the question is clearly asked about code that is compatible with both tags. When I have an issue is when someone asks an unclear question that could be answered in a C++ specific way but you can't tell if that's what they want or not. printf can be used in both, so both tags seem fine to me. Commented Jun 17, 2017 at 0:26
  • 5
    @Braiam There are two ways I find questions to answer. One is monitoring the home page, which shows me a customized list of questions based on the tags I'm most active in. The other is doing a tag search with a custom chosen list of tags, which will show me the most recent questions having any of those tags. If you guessed that [printf] is not one of those tags, then you are correct. Neither are any other obscure tags. From talking to others, I'm not alone in using the site this way, so it may not be true that no one will find it, but many of us won't, and that's a net loss to everyone.
    – Cody Gray Mod
    Commented Jun 17, 2017 at 12:07
  • @CodyGray so, because n=1 you are a representative sample, right? Congrats
    – Braiam
    Commented Jun 17, 2017 at 14:31
  • Oh, and btw, @CodyGray, printf tag has way less unanswered rate than c and c++. So, your point is moot. printf questions are being answered more than any other tag you could use.
    – Braiam
    Commented Jun 17, 2017 at 14:34
  • @RetiredNinja #include <stdio.h> is obsolete form since pre C++98. Compilers just support it as a non-standard extension. There is no guarantee that it will work.
    – Lundin
    Commented Jun 17, 2017 at 18:37
  • 4
    @Braiam Most people use the site by bookmarking the tags of interest to them. For example, I would personally be able to answer this particular question. I follow the C tag but not the printf tag. So by removing the C tag you evidently remove attention from the question. The fact that printf has a high accept rate might be that the major purpose of printf nowadays is learning purposes and most people using stdio.h are beginners. Therefore a whole lot of very easy questions will be associated with printf.
    – Lundin
    Commented Jun 17, 2017 at 18:42
  • @Lundin "I follow the C tag but not the printf tag" again, n=1. Understand, you are not a representative sample! Don't push your views on others based on your anecdotal experience. There are less unanswered question in printf tag than in C, so your point is moot. Those questions are getting answers.
    – Braiam
    Commented Jun 17, 2017 at 18:55
  • 2
    @Braiam "There are less unanswered question in printf tag than in C..." did Lundin not answer this with "Therefore a whole lot of very easy questions will be associated with printf"? "Those questions are getting answers" in part because they're easier to answer. Can you find one popular answered question (preferably multiple answers) tagged printf without a language tag as well? How much time did it take? Now see how easy it is to find popular answered questions with printf and a language tag. More people include the tag for a reason - it garners more attention. You can't change reality.
    – iRove
    Commented Jun 18, 2017 at 3:38
  • @iRove quite easy stackoverflow.com/posts/610406/revisions, top one ordering from votes. Never had a C-like tag, just js.
    – Braiam
    Commented Jun 18, 2017 at 16:10
  • 1
    @Braiam I never argued JavaScript wasn't a language. That question is tagged with a language - it doesn't have to be C-based. If it wasn't tagged with a language (js), it probably wouldn't have gotten nearly as much attention.
    – iRove
    Commented Jun 18, 2017 at 16:29
  • @iRove I'm not sure then what you think I want to demonstrate. That question quite catch my point: you don't need either C or C++ to answer printf questions.
    – Braiam
    Commented Jun 18, 2017 at 16:46
  • 2
    @Braiam Sure, but I was responding to the idea that "not every question needs a language tag." My conclusion being if you want to maximize attention on a question, you will want to tag a related language. And that even if one person isn't a "representative sample" to show that more people will find questions via tagged languages, a quick search will show that to be generally true rationale.
    – iRove
    Commented Jun 18, 2017 at 17:12
  • 1
    @Braiam Nobody goes around searching for printf questions to answer and everyone with a minimum of experience using the site can tell... to argue against that is just silly. But regardless of that, 2 of the 3 people who answered the question with quality answers have expressed concerns about the tags, either directly (the OP) or indirectly (by editing to correct tags). Which means that the amount of good answers would most likely have dropped by at least by 2 if there was no C tag.
    – Lundin
    Commented Jun 20, 2017 at 6:30
  • 2
    @Braiam "...everyone with a minimum of experience using the site can tell" Do you do anything else around here, but trolling other users at meta? You barely have any SO participation, so it's no wonder that you don't understand how the site works. I'm not going to teach it to you, go learn by doing. In particular, you have zero participation in the C and C++ tags so why are you even responding to these questions? It seems very unlikely that a person with zero experience of the topic has something to add to the discussion. I'm done talking with you.
    – Lundin
    Commented Jun 20, 2017 at 11:54

You must log in to answer this question.

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