2

I'm just referring to the question below.

The best way to check if List<String[]> contains a String[]

And the OP already using one way which is the best AFAIK. So I just posted my answer (even commented first :) ) as that is the best way.

https://stackoverflow.com/a/25420258/1927832

Later got a comment which goes on like in my opinion this is not a response.....

What I though is it's just like a Yes/No type of question. And answered.

How to respond such type of questions. Just for god's sake I shouldn't answer that ??

1 Answer 1

1

The actual question being asked there is…

Is there any better way [than what I've shown above] to check if ArrayList contains a String[]?

Yeah, I know, there's not actually a question mark there, but it is implied.

So if they've shown the best solution, then the answer is obviously, "No, there is no better way."

Of course, a good answer will build on that core, explaining why that approach is the best way and perhaps even explaining why some other common approaches are inferior.

As it stands now, your answer is rather weak but it is an answer. Perhaps the commenter was trying to encourage you to expand upon your answer as I've alluded to above?

It is also concerning that you don't sound very confident. You essentially say that as far as you know, it is the best method because it was provided for that purpose. First of all, this begs the question of how far you know. Why should I believe your guess? Why should your guess hold more weight than mine, or the asker's guess? Second, it is not necessarily true that something is the best tool for a job just because it was designed for that job. It might have been poorly-designed, or there might be something even better out there.

Now, to be fair, the definition of "best" is ambiguous. What does it mean to be the best? The fastest? The least memory-intensive? The most widely-recognized idiom? The easiest to maintain? The most scalable? Or any host of other reasonable definitions. So the question isn't a particularly good one. It is in need of some additional clarification. In particular, someone should ask (in a comment), "What do you mean by 'better'? What are you hoping to achieve? What makes you uneasy about the code you have now?" (or something to that effect). Until that follow-up question is answered, it is a difficult question to answer. As such, I would have avoided answering altogether in this particular case.

But more generally, it is, in fact, an answer to say that the code in the question is correct, that you are already doing it the most appropriate way.

Also related: Is “Don't do it” a valid answer?

1
  • Thankyou for the brief answer. This is a eye opener. Commented Aug 21, 2014 at 9:50

You must log in to answer this question.

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