Meta Stack Exchange is where users like you discuss bugs, features, and support issues that affect the software powering all 153 Stack Exchange communities.

What is meta?
Here's how it works:
  1. Any Stack Exchange user can ask a question
  2. The community provides support, votes on ideas, and reports bugs
  3. Your voice helps shape the way Stack Exchange operates

I asked this question on Stack Overflow where I asked about the proper way to handle the database in Android. Why I asked this was because I had seen different answers on which would be the proper setup. It got [on hold], put on hold as primarily opinion-based and I cannot understand why.

How is this opinion based? Clearly there is only one implementation of code that is superior to another. Just because I presented two different answers does not make it a duel. One of them was wrong.

How should I have phrased the question to prevent being put on hold?

share|improve this question
You found conflicting opinions on how the database should be handled and now you're asking others for their own opinion on what is right. – slhck Nov 20 '13 at 9:19
@slhck I see. I do not want other opinions, I want facts. What were presented in the answers was code and how you do the implementation. There was no fact that this is the right way to do it. This is why I asked the question. I understand you answer my question "How is this opinion based?" and I do not mean to argue with you. Thanks. – Simon Zettervall Nov 20 '13 at 9:22
I'm just giving a possible interpretation – I'm not a close voter and not really a Stack Overflow regular either. The question is how you determine whether some implementation is the right one? What exactly are your criteria? If you're just asking which one is better, this boils down to opinion. But if you want a more secure one, or a stable one, a memory-efficient one, etc, then this would be something based on facts. – slhck Nov 20 '13 at 9:24
@SimonZettervall while I didn't vote on your question, I think putting some code inside your question would have helped immensely. It still might. Reviewers and mods see a TON of questions every day and when there is a question that is only text and no code, tolerance goes down ;) Try and add each code snippet from each question and put in comments with your questions in them. – gideon Nov 20 '13 at 9:25
Rule of thumb: If you find yourself asking "...what is the correct way to..." it is an opinion based question. "Correct" is a mere concept of error freeness which differs based on who you ask/viewpoint, not (or seldom) an absolute. – Time Traveling Bobby Nov 20 '13 at 10:12

It is opinion-based. You presented two viable options, essentially asking which one is better.

Clearly there is only one implementation of code that is superior to another.

That's not true. There are often many ways of doing something in most programming languages. Each has its own advantages and disadvantages.

In this specific case, consider needing to query the database every millisecond. Presumably it would be better to keep the connection open all the time. When you only need to query the database once every few minutes, it would make more sense to close and reopen the connection. In borderline cases, ease of implementation can also come into play.

How should I have phrased the question to prevent being put on hold?

  • You could simply ask how to do it, and present both options as answers and see which one accrues more upvotes (there are some flaws to this, for one thing, this may lead to an opinion-based answer - they may simply be voting on the approach they like more, not necessarily the 'better' one).

  • You could also possibly ask for the advantages and disadvantages of each approach. Typically such questions would be closed as too broad (and sometimes incorrectly as opinion-based), but in this specific case the question seems localized enough to make this a viable option. (This is just my opinion, but hopefully most of the community agrees, but if 5 people disagree, you may find your question closed, at least until a few people decide that it shouldn't be closed, but that's how this site works)

    Adding your unique requirements here may help to prevent the question from getting closed, but don't make this the primary part of the question (e.g. just add a footnote to your question), as this would result in a very localized question, which could result in many very similar questions which can't be closed as duplicates because they all have very slightly different requirements (although a good answer to any of them would allow for this to happen).

  • As gideon mentioned, adding some code to your question could also help.

share|improve this answer
"How should I have phrased the question to prevent being put on hold?" section of your answer seems to lack one option: "Describe your conditions and requirements as best as you can and then ask which option fits better (or simply, how to meet them)." – Mołot Nov 20 '13 at 9:37
@Mołot I prefer to stay away from that approach as you end up with a very localized question, although a good answer will be generic, giving enough information for anyone to be able to pick the correct approach applicable to their unique situation (and if the best answer would cover that, why not have the question ask that instead). – Dukeling Nov 20 '13 at 9:42

The simple fact that you have 2 separate questions saying the opposite I think covers why this is opinion-based. Different people are going to interpret it differently and have differing opinions on which is better. So in that respect, any answer is going to have some basis in opinion and based on personal preference.

There is a class of questions that have been loving dubbed Gorilla vs Shark. The blog article I linked provides the full story, but this question, falls into that category. You are basically asking "which is better" and assuming that one is clearly superior in all cases and won't require a novel to answer.

To help better improve your question, ideally you need to provide some scope for your problem. Things like how often is the database being written too, how much data, are you editing or inserting or deleting, etc. These bits of info would narrow the question down and allow someone to provide a good concise answer.

From the wording on your problem, however, it looks like you don't have an actual problem and were wondering in general, so it may be difficult you to restructure this in the way I mentioned, but I think that is the best way to do it.

share|improve this answer

You must log in to answer this question.

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