What is meta? ×
Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 130 Stack Exchange communities.

Yesterday I asked this question - which is about methods to use bitwise operations to interleave zero and non-zero bytes. It has a practical application in UTF-8 to UTF-16 conversion.

The question is narrow and specific - it could pretty much be an interview question or appear on a CS 101 test. The bit operations in question appear with identical functionality across C, C++ and Java (if you accept that >>> in Java is equivalent to a cast unsigned in C/C++).

I tagged it that way because those are the languages I'm targeting and I expect answers to be equivalent across languages. Indeed the example, and most of the suggested answers all compile as-is in each language (the exception being the 'union' answer which is only directly applicable to C and C++).

The question, however, was closed as "not constructive", mostly, it seems, because of the multiple language tags. Browsing the high level guidance here and on the main SO site, questions closed for this reason are usually vague, lead to open ended debate, aren't questions at all, etc. The FAQ states:

We expect answers to be supported by facts, references, or specific expertise, but this question will likely solicit debate, arguments, polling, or extended discussion.

I feel like this question doesn't pose any of those problems. So I'm here to ask the community if multiple language tags a truly a red line, and if even if they aren't to comment whether they were appropriate here.

It's pretty clear I could define a meta-language, which consists of exactly the bit-wise and arithmetic operators I'm interested in, and ask this in that context, but that seems much less useful than using the common parts of the languages I'm interested in and that the community understands.

share|improve this question
2  
The Not a Real Question reason probably applies more to that question, "It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, see the FAQ." (emphasis mine). –  Servy Dec 11 '12 at 21:35
    
The question comes closer to a Code Golf-esque challenge type question than something for SO. NARQ would be closer for me than the not-constructive reasoning. Though the wide variety of possible and acceptable answers across various languages might indeed push it in that direction. –  Bart Dec 11 '12 at 21:44
    
I don't follow how the question is ambiguous, vague, incomplete, overly broad. Which of the four does it fall under? I think it's pretty explicit - a straightforward algorithmic question, with both a description of the problem, and a reference implementation in case the description has some ambiguity. –  BeeOnRope Dec 11 '12 at 21:56
2  
Asking for best performance in several languages is definitely not constructive, on more than one level. Not to mention the non-existing language "C/C++". –  Bo Persson Dec 11 '12 at 22:08
    
I didn't suggest C/C++ was a language. It means "C and C++". Can you provide some insight on the multiple levels it is not constructive? In my experience primitive operations like this boil down to similar or identical assembly, especially in C and C++. How would you ask this question? One question for each language? –  BeeOnRope Dec 11 '12 at 22:12
    
I would note there are plenty of similar questions, tagged with multiple languages which are both highly upvoted and with solid, upvoted answers. This one even has the dreaded C/C++ non-language mentioned right in the title! So I conclude there is either a substantial difference between that question and mine (what is it?), or this question should have been closed, or mine should not have been closed. Which do you feel applies? –  BeeOnRope Dec 11 '12 at 22:15
    

2 Answers 2

up vote 5 down vote accepted

I actually earned a bronze tag badge for a language that I seldom use due to people tagging a question rather broadly in hopes of getting it a larger audience. It's not tags that determine if a question is constructive or not, it's how broad the question itself actually is.

I'm rather on the fence when it comes to your question, and it seems like the community is as well. You start off well:

  • The problem is clearly defined
  • Your own efforts are included
  • You're seeking an answer that utilizes only common bitwise operations

Then, it gets a little cloudy:

This is a language agnostic question and I'm interested in a language agnostic solution, but to make it concrete, you can consider the following operators to be present:

That's a little reaching, because precedence across languages varies. However, you could easily narrow it down by saying that you'd like something that worked across Java, C and C++. If you go 'full blown' language agnostic (toss Python, Perl and PHP into that mix), the question just reaches too far.

It's also a little ambiguous, as you've already received one answer suggesting that you use a union for a C++ implementation, where you've attempted to specify that an implementation should not rely on specific language features.

A moderator left a comment on the question that says pick a language, but I'd venture to say that you could stipulate a few. If you just narrow the scope in the last part of your question, I think you'll see a better reception, and quite possibly additional interesting answers.

share|improve this answer
    
Thanks for the comments. In fact, the text you referred to I added only recently, after the question was closed, in attempt to clarify the language situation - rather than just leaving it implicit. You make a good point about precedence, although in this case all of the arithmetic & bitwise operators have the same precedence across all three languages (in fact, C, C++ and Java are pretty much completely aligned in that respect with the except of some obscure statements with side effects which are undefined in C/C++ but well-defined in Java). –  BeeOnRope Dec 12 '12 at 3:34
    
I'm going to clarify that I'm interested in only C, C++ and Java where I said "language agnostic" - that's what I meant, but on re-read it's not obvious (even if you looked at the tags). –  BeeOnRope Dec 12 '12 at 3:35
    
@BeeOnRope I think that would land the question firmly in objective territory. If you still get a bad reaction to it, well, haters gonna hate and all. –  Tim Post Dec 12 '12 at 3:38
    
I caved and removed the C and C++ tags, reformulating it as a purely java question (and I'll secretly use the same implementation in C and C++, without telling anyone). Thanks for the advice. –  BeeOnRope Dec 12 '12 at 6:06
1  
@BeeOnRope Looks like it's sorted out then, you're welcome :) –  Tim Post Dec 12 '12 at 6:20

Questions using multiple language tags are not automatically not constructive; it all depends from the question.

For sure, questions asking for a comparison between two languages are not constructive, but questions asking the equivalent code to write in a different language are normally not constructive. If I were to ask code to write for a C extension for Perl, I would tag the question with , and .

As for questions using multiple language tags, there are 217 open questions tagged c, c++, and c#, and 51 closed questions using the same tags. I cannot tell you if there are questions using those tags that have been deleted, as I am not a Stack Overflow moderator, and I cannot search for deleted questions.
It could be some of those questions should be retagged to remove one or more tags, but that shows that questions using more than a language tag are not automatically not constructive.

share|improve this answer
2  
The overly broad tagging is usually indicative of an (albeit misguided) effort to get more eyeballs on a question, but there are a few gems where all of the tags theoretically apply. If you ever wake up to learn you received a tag badge for some language you hardly use and wonder how, blame bad tagging :) –  Tim Post Dec 12 '12 at 2:35

You must log in to answer this question.

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