6

According to this quesiton: Java - Number of 1s = 0s in bit string, Bohemian (diamond moderator) commented to me while I am trying to help the asker with this comment"

"That is not relevant or desirable. I am seeking to clarify the question, to make it more valuable. Shotgun answers only encourage poorly defined questions"

Here, the user wants to count the number of ones and zeroes in a particular bit string using bitwise operators. However, he converted the initial int variable into a BigInteger, and then into the String representation of this BigInteger. It seems that this question is quite unclear (as how Bohemian stated that it is a "poorly defined question", since he didn't give an example of what a "bit string" is, and how he confuses "bit Strings" with numerical values such as a BigInteger or a primitive int. By the meaning of "bit string" I assumed that the bit string can be of any length, which may be far larger than even the largest value stored by a long

I have already provided the answer using the best of my efforts so hopefully the asker will understand how to count the bits of a numerical value (aka "bit string") using bitwise operators for both BigIntegers and primitive integers and dismisses BigInteger. However, the other answer deals with only integers, also it is upvoted.

I have edited and reposted my answer because based on Bohemian's comment, my answer could be a "shotgun answer" for a "poorly defined question," until I can edit it to become more relevant. However, from the user's comment, my answer isn't a "fastest gun in the west" answer, but I used my effort to help the asker the best I can, and give instructions how to reproduce it (it is easy to reproduce anyhow). The previous answer that got upvoted came first.

Is my answer a "shotgun question" to a "poorly defined question?"

11
  • 3
    My answer is not a "lightning fast" answer. IT came after the upvoted one. Commented May 27, 2018 at 7:22
  • 6
    It doesn't matter which came first. What Bohemian is telling you is that the question is unclear, and it is not desirable to try to cover all the bases just to be able to answer early (earlier than the question gets clarified).
    – user2285236
    Commented May 27, 2018 at 7:29
  • @user2285236 I have reposted the question highlighting that it isn't entirely clear what a "bit string" is meant and suggested an improvement to the asker's function. However, my answer should be reasonably good enough for the asker to clarify and edit the question. To make this answer better, is it recommended that I should provide an input/output, since I commented that this code is reproducible. Commented May 27, 2018 at 7:41
  • From "How to deal with unclear questions and their lightning-fast (“fastest gun in the west”) answers?" it seems more that my answer isn-t lightning fast, nor is the other answer, so it shouldn't be a duplicate. It is something different, as in suggesting the asker to improve their question to make it clearer, and therefore increase the relevance of both answers. Commented May 27, 2018 at 8:22
  • Although unrelated, some suggestions for your edit: you should (1) remove the "Java - " in the title, we have tags for that (although "in Java" is ok) - meta; (2) remove the 'thank you' - meta -- because you still didn't have 2000 rep, your edit may be rejected as "too minor".
    – user202729
    Commented May 27, 2018 at 9:45
  • 4
    Honestly, the strangest thing about it is that the question only has a single close vote. If a question is so unclear it shouldn't be answered, then it should be closed, in my opinion. I don't think there's an inbetween where you shouldn't close it but should discourage others from answering. Bohemian, being a mod, could single-handedly close it, and reopen it once it was edited into shape.
    – Erik A
    Commented May 27, 2018 at 10:02
  • @user202729 there's no "too minor" reject reason.
    – Braiam
    Commented May 27, 2018 at 11:22
  • 4
    This question fits an entire category of questions, quite common lately. They are actually easy to handle, but SO does not have a condoned mechanism to do so. The OP's real problem is that he does not know enough yet to type the proper keywords in a Google query. So can't find anything and comes to SO. A comment like "Please google 'java how to the count the number of bits'" is pretty likely to give him want he wants. But only works in small tags. What SO needs to make this work in big tags like [java] is a "Propose a search query" feature. Commented May 27, 2018 at 12:49
  • That question seems like a typical and common example of how not to show what you tried and needing to break the problem down to smaller parts (i.e. the essence of programming). Their code can be removed from the question without affecting the rest of the question at all (apart from being able to see the type of the input), which makes including it kind of pointless. Furthermore, they should break it down into smaller parts (possibly first restate it as 2 * #1's == bit length, then figure out how to determine bit length / count) which can be researched or asked about. Commented May 28, 2018 at 8:20
  • What was your answer?
    – peterh
    Commented May 30, 2018 at 9:49

1 Answer 1

8

@user2285236's comment above is accurate, but I'll give some more explanation of my comment.

General stuff

We strive to create a site that has answers to specific questions. If a question is ambiguous, and especially if the nature of the ambiguity would result in quite different approaches to give an answer, it's preferable to clarify the question before answering.

When an ambiguity only requires a tweak to the answer to cover the variations, it's probably OK to post code with and without the tweak and describe the twaek. For example, if a question asks for a regex to match only letters, but OP only gives examples in uppercase, we're unsure if OP wanted only uppercase. I think it's OK to answer like:

/^[A-Z]+$/
/^[A-Z]+$/i   // add ignorecase flag to match lower case letters too

The two variants are so similar it's basically still "one answer".

You might think having a one stop shop answer is a good thing, but it's impossible to know which part of the answer voters are voting for. Proper voting is critical to the success of the site.

Specific stuff

IMHO, this paricular question was not such a question, whose answer depended on how to count the total bits of a number. To get claification, I posted this comment:

How large is your largest expected number? Do you start counting total bits from the first 1 bit, or from the range for the type, eg long has 64 bits total no matter what the value is or does 2 have 2 bits total? –

To which Mulliganaceous replied:

@Bohemian I have provided solutions that handles both BigInteger and primitive cases.

To which I replied:

@Mulliganaceous That is not relevant or desirable. I am seeking to clarify the question, to make it more valuable. Shotgun answers only encourage poorly defined questions.

Breaking my comment down:

not relevant

The fact that an answer was posted is not relevant to clarification being needed.

not desirable

Posting an answer (and advertising it in a comment) that is essentially multiple answers, lessens the request for OP to clarify. OP may well find what (s)he needs buried in the answer and not reply with more info - that is not desirable. In fact OP did not clarify.

more valuable

In general, specific questions, and specific encyclopaedic answers, are more valuable to the site and future visitors.

Shotgun answers

Those that hit many targets with one shot (perhaps scattergun would have been a better word choice)

only encourage poorly defined questions

OK, maybe not "only"... but having them lowers the bar on site quality by tolerating ambiguous questions and "multi-answer" answers, which IMHO undermines the site.

2
  • 6
    @Mulliganaceous you didnt downvote the asker, you downvoted the question. We vote on content, not people.
    – user4639281
    Commented May 27, 2018 at 18:18
  • I have downvoted the question, suggesting that he should clarify between whenever he should use BitInteger or int. Commented May 27, 2018 at 20:55

You must log in to answer this question.

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