-16

This question is tagged C++, this one is tagged as C. On meta it has been discuss questions should not be tagged as both and this meta question has a comment by a mod saying the below

"Since the solution is valid for both" This is the fatal flaw. There is no way that the person asking the question can know that

If that's the case shouldn't the C question not be considered as a duplicate to C++ questions? Should the C question not be closed?

13
  • It honestly looks like you're asking the same question. C and C++ are close enough that the solution in C would likely work in C++. Better yet, the answer provided even gives you an answer with C++ too. What were you hoping to accomplish by splitting this into two questions?
    – Makoto
    Commented Oct 28, 2017 at 18:08
  • I didn't want to. My question was downvoted to hell after someone made a question on meta regarding tagging it as C and C++. It was also closed. I thought it'd be appropriate to make a C specific question since the languages are different and ask about UB in C. However... that got closed as a duplicate. I'm confused. Must questions/answers be specific to one language? (as the meta thread states and has other questions linked saying it should be) or can it be both since one is a subset of the other?
    – user34537
    Commented Oct 28, 2017 at 18:10
  • 3
    I suppose we're dancing around the main question: what language did you originally intend your question to be in?
    – Makoto
    Commented Oct 28, 2017 at 18:12
  • @Makoto: That's beside the issue if I wanted to write another question do I choose both language since I'd accept an answer in both language? or just one? Also if I can only choose one then shouldn't the C be not a duplicate?
    – user34537
    Commented Oct 28, 2017 at 18:13
  • 5
    Normally I'd agree, but...given the fact that you brought up the Meta question, that is the issue. That's what the extra scrutiny and attention is likely about, as evidenced by the commentators' reactions to it. Answering that part will at least start the process of getting clarity.
    – Makoto
    Commented Oct 28, 2017 at 18:14
  • @Makoto: I'm not on meta much. Was there ever consensus if C and C++ should always be split? This doesn't seem so. Yet the C++ question was closed because it use to have both
    – user34537
    Commented Oct 28, 2017 at 18:35
  • 2
    @acidzombie24 It's not specifically about c vs c++ as much as having one language tag per question. And yes, that is pretty much a consensus that is had, except for question that are specifically language agnostic, in which case you would not use either. Commented Oct 28, 2017 at 18:36
  • @FélixGagnon-Grenier: Correct me if I'm wrong but you're saying I should not use C and C++ in a single question. In that case shouldn't the C question linked above not be closed as a duplicate?
    – user34537
    Commented Oct 28, 2017 at 18:50
  • 1
    @acidzombie24 No, I don't think it should not be closed as a duplicate. I have no problems with a question about utf8 encoding problems in java be closed as a duplicate of a question about utf8 encoding problems in c, or c++, if the answer is alike. Commented Oct 28, 2017 at 18:55
  • 3
    I would have voted to close as too-broad not because of the two language tags. For me, this question is missing information on what you expect in the end. Do you want a string containing the hex-representation to print it? Do you want a float that simply has this value?
    – BDL
    Commented Oct 28, 2017 at 20:53
  • @BDL you didn't really think did you? Floats aren't big enough but I assume you mean double. The representation doesn't have to be IEEE-754 and I wanted IEEE-754. So putting the value into a decimal might not be the answer. Also accessing raw bits from double in C++ might be undefined behavour. I said I wanted the representation. As long as I can access the bits without occurring undefined behavior it doesn't matter how. For all I care it could be vector<bool>.
    – user34537
    Commented Oct 28, 2017 at 21:04
  • 5
    @acidzombie24 It's a pity that you did not include that reasoning in your question. It would have probably increased its quality and avoided some of the hassle shown here.
    – E_net4
    Commented Oct 29, 2017 at 0:51
  • 1
    Well, that make sense, because your first question has been answering with C and C++ solution because you tag both in the first place. So the duplicate make sense. The solution would be to update answers to give a only C++ solution. But I will say that this is too late to remove C tag because you will destroy the answer. (This is the main reason why a lot of legacy question with both C/C++ are still on this site example)
    – Stargateur
    Commented Oct 29, 2017 at 7:47

3 Answers 3

8

I already clarified this in the discussion that prompted this question, but I suppose it's worth promoting that to an answer here…

Simply put, determining whether a question is a duplicate is a completely separate matter from deciding how it should be tagged, and thus the "fatal flaw" that I cited for tagging doesn't exist for assessing duplication.

Quite unlike tagging, the people who are voting to close a question as a duplicate are expected to be experts in the relevant technologies, and thus are perfectly capable of making the determination that the answer is identical for both C and C++. In these cases, a C question can be marked as a duplicate of a C++ question, and vice versa. If the answers would be different, then the questions are not duplicates, and either should not be closed as such or should be re-opened by an expert.

This is facilitated by the fact that we give gold tag badge holders the power to close and re-open questions as duplicates with a single vote. If you tag the question with the language you are interested in (say, C++), then it gets marked as a duplicate of a C question, it's entirely possible (and, anecdotally, not uncommon) that a C++ expert will come along, determine that there is sufficient difference between C and C++ in the question's scope, and thus re-open the question.

The acid test for duplicates is, do these two questions have the same answer? If so, then they're duplicates. A qualified expert is able to judge this, which is why we give them the power to immediately mark duplicates, and why we don't impose any arbitrary limits based on the questions' tags.

Again, this is totally different from the "predicting the future" tagging issue that I was talking about over there. You tag the question when you ask it, and the asker almost by definition does not know whether the answer will be the same in C, C++, Delphi, or whatever other languages. The asker also doesn't care. It's the responsibility of the answerer to know/verify this, and marking a question as a duplicate is just a special sub-case of answering it (i.e., answering it by saying, your answer can be found here on this other question).

2

If that's the case shouldn't the C question not be considered as a duplicate to C++ questions? Should the C question not be closed?

I generally find it acceptable for questions to be closed as duplicates of a question with a different language tag when the answer is actually usable for both situations.

For instance, the utf-8 all the way through question is liberally used as a duplicate target for questions about encoding problems, because whatever the language, it amounts to mostly the same thing.

In this specific case, I am not a thorough domain expert, but it seems to my uneducated eye this is a valid duplicate target since both question seem to be solvable by the answer.

2
  • My argument was the answers are acceptable in both languages but a few hours later it was closed being too board and meta people saying it isn't acceptable.
    – user34537
    Commented Oct 28, 2017 at 19:11
  • Another thought. Isn't that ridiculous if a person wants to answer the question specific to one language but can't because it's been closed/duplicated as another language the answer doesn't fit into?
    – user34537
    Commented Oct 28, 2017 at 23:50
0

I'd post this as a comment but I can't.

I understand tags to work conjunctively not disjunctively

Tech A AND Tech B AND Tech C

this means that you want an answer that fits all those criteria.

The following interpretation is not helpful:

Tech A AND ( Tech B OR Tech C )

Because that means that you are actually asking two questions. as such, your question is too broad because you should only ask one question per question.

It is better to ask two separate questions. If the questions turn out to be not exclusively disjunct, a redirect will be created (duplicate of X.) This is not a bad thing!

When asking questions, think about the problem you want to solve, and not problems other people may want to solve in the future, or about how you can trick the system into giving you the most points. This way, the site works the best. Thank you. :^)

2
  • But... when a person wants to answer the question in C and it's closed/redirects to the C++ the answer wouldn't fit in. What about that case?
    – user34537
    Commented Oct 28, 2017 at 23:48
  • 4
    @acidzombie24 this site is not about giving people the opportunity to signal their mad skillz. this site is about answering questions. will two questions get the same best answer? if yes, one is a duplicate.
    – guest
    Commented Oct 29, 2017 at 1:35

You must log in to answer this question.