41

After reaching 500 rep I kinda started doing some reviews every now and then and often stumble across questions that ask for the best way of accomplishing something.

The questions are usually phrased like this:

  • What's the best way to trim a string?
  • What's the best way to make an HTTP request in C++?
  • What's the best library to do this and that?

To me these kind of questions appear primarily opinion-based. Everyone has his way of doing things, some favor other approaches to solutions than others do.

Most of these questions are either duplicated or off-topic but a fair amount is still okay. Some are still new and I used to flag them for being primarily opinion-based. However in the past some of my flags were rated disputed, so I'm wondering if I'm doing something wrong here or missing something? On what criteria can I decide if they are primarily opinion based?

Just to be clear, I don't just flag every question asking for a good or the best way of doing something. There are obvious cases where a question can be answered with the best or only acceptable way. So it's also dependent on the situation of course.

Example

I flagged this question for being primarily opinion based: How to Decrypt TCP Traffic Using Wireshark? and the flag got rated disputed. The OP asks:

What is the best way to go about finding queries of PostgreSQL?

Even if I'm not an expert in this area I felt like the way he asked could result in opinion based answers or discussion. So I flagged it.

21
  • 13
    Well, it depends. Some of them are opinion based, some are too broad, some using "best way" as an empty phrase to hide the code writing request and some are on-topic. So do you have some examples of your disputed flags?
    – Tom
    Commented May 2, 2017 at 11:04
  • @Tom good point! I added an example. Though I don't want to make this look like a complaint why my flag got rejected. I'm trying to find out on what criteria I can rate threads asking for the best way primarily opinion based or not :)
    – Vinz
    Commented May 2, 2017 at 11:15
  • 24
    A rule of thumb I apply: if a trivial rephrasing can make the question clearly on-topic without changing what it's asking, then it's already on-topic. That often (but not always) means treating "How can I foo the bar?", "What is the best way to foo the bar?" and "Is there a tool or library I can use to foo the bar?" as identical questions, because usually the different phrasing doesn't change what answers are appropriate. It's the substance of what's being asked that matters. It's often still worth rephrasing all of the above to the "How to" variant to avoid other people VTCing them, though.
    – Mark Amery
    Commented May 2, 2017 at 12:31
  • 11
    Occasionally, those questions are a matter of semantics. In your example of "What's the best way to trim a string?", if it is reworded to "What is the most efficient way to trim a string?", it's the same question, but absolutely on topic. Those kinds of questions can have a definite answer, but not all the time. Ones like "What's the best way to make a website?" are also too broad, and opinion based.
    – krillgar
    Commented May 2, 2017 at 12:43
  • 1
    I would think that asking for 'best' tends to be opinion based because it can refer to a nebulous and expansive set of evaluation criteria, and therefore is heavily impacted by the importance that an individual places on those varied aspects. However within certain contexts there can be fewer and more empirical evaluations. In any event, I would not say that this always pushes a question to be primarily opinion based.
    – bitnine
    Commented May 2, 2017 at 12:46
  • 6
    "There should be one-- and preferably only one --obvious way to do it."- Tim Peters, The Zen Python Commented May 2, 2017 at 13:09
  • 1
    If you have some means of actually benchmarking and proving that something IS the best way performance wise (and it's still readable) then this may not in fact be opinion based at all. That being said, this is more often than not, not the case when questions are worded this way. To be fair though, they should be worded as what is the most efficient way in these cases. Commented May 2, 2017 at 13:12
  • 2
    @MarkAmery I can relate to that, I found a lot of questions that had an on topic question in them but were closed as library shopping questions because they were worded slightly the wrong way. I think it's a good idea to help OPs move questions away from close reasons (if it can be done without completely changing everything in the post).
    – jrh
    Commented May 2, 2017 at 13:14
  • 11
    I think every question implicitly wants the "best way", or at least a good one (i.e. an efficient, readable solution etc.), so really the phrase is just redundant. So "What's the best way to trim a string?" can be simplified to "How to trim a string?". Commented May 2, 2017 at 13:20
  • 6
    @Chris_Rands - "lol no" - Perl Commented May 2, 2017 at 14:05
  • 1
    The author will not be aware if there is indeed an objectively best way to do something, yet it still may exist. ... which may also hold true for the reviewer.
    – Thaylon
    Commented May 2, 2017 at 15:47
  • 1
    Whenever a question seeks the best, fastest, most efficient, ... solution I always ask for metrics. Do you want the most L1 cache hits on the processor or the fewest index reads in the database?
    – HABO
    Commented May 2, 2017 at 20:52
  • 4
    A good test is to replace "the best way" with "a way". Is the result off-topic? If on-topic, then you will know what the best answer is by the upvotes.
    – Laurel
    Commented May 3, 2017 at 1:15
  • 1
    Obviously not: stackoverflow.com/… gives you ~10k questions with that phrase with scores up to 1400. It seems there is indeed a best way to iterate over a C# dictionary. The question body however only asks about the standard way (whatever that means...). Commented May 3, 2017 at 12:07
  • 1
    Stackoverflow is all about opinions, that's what voting is for. Even if performance can be measured in nano/milliseconds, you can't quantitatively assign value to things like UX and design, so you use votes for the quantitative measurement. We should be focusing on what makes the site useful to developers, not what is most logical. Commented May 3, 2017 at 18:36

15 Answers 15

54

Before you make a blanket statement saying, "yes these questions are always not allowed", perhaps it'd be worth the extra effort to uncover what these questions are actually asking. Specifically, you need to look at what scope these questions cover.

In general, questions which are unbound on their requirement are typically seen as off-topic. That is to say, questions which ask, "What is the best way to trim a string?", or, "What's the best way to make an HTTP request in C++?", are often unbound in scope. This is because there are any number of possible answers or any number of possible approaches to this problem which makes it difficult to give one concise and possibly authoritative answer on.

To your specific example, however, the question is simply using an unfortunate turn of phrasing to get their point across. They're really not looking for the best way to do something, they're looking for how to do something. They don't know how to get the uncoded form of their TCP capture from Postgres, but they're able to do so from MySQL. Admittedly, without any clear details on how they set it up it'll be tough to answer unless you're truly learned in Wireshark and PostgreSQL integration (which makes it a candidate for "Why isn't this code working"-type closure), you're not going to be able to satisfactorily answer this.

To recap: context matters. If the context of the question is overly broad and wide-open, then it's simple enough to close. If it's using a turn of phrase which could lead to confusion, take this as an invitation to submit an edit which can fix it.

6
  • 5
    I find that very few "what is the best way"-question, when it's about programming, are purely opinion based. Usually they can be answered, well, by answering the question "what is the standard way to do something", "what is the best way to do this, optimized for this other thing", or as you point out "why isn't this working". I.e. context matters.
    – Clearer
    Commented May 3, 2017 at 9:39
  • 16
    @Clearer in my experience, people asking for "the best way" are actually just looking for "any way", and people answering "the best way is X" generally only know of X, and not Y nor Z nor the drawbacks of either. It doesn't really have anything to do with "opinion-based", but simply poorly asked questions that require editing.
    – CodeCaster
    Commented May 3, 2017 at 9:55
  • 1
    We could kind of modify the questions accordingly but then this might defeat searches of users for "best way to ...". Let's face it. Searching for the best is a human trait. Commented May 3, 2017 at 12:10
  • "They don't know how to..." Sure. Best is probably meant as a mixture of fastest executing, shortest code, reasonably safe, most following convention. We don't know and it would be nice if people would actually say what they want. The question is what to do if people don't say that? Not answering at all or quietly dropping back to some obscure definition of best? Commented May 3, 2017 at 12:15
  • 5
    @Trilarion: If all it takes for us as a culture to break the mentality of always asking for the "best" when we don't mean to is to edit questions, then mission accomplished.
    – Makoto
    Commented May 3, 2017 at 18:12
  • I'm accepting this as answer because I agree that most of these questions (specially by new users) actually search for any way of solving something or how to solve something rather than the best practice. I also agree that a blanket statement can't be made on those, they require further looking-into.
    – Vinz
    Commented May 7, 2017 at 23:40
12

Unless other criteria had been given. I'd say "Yes", these questions are primarily opinion-based.

"Best" isn't a context by itself, and as a GPU has multiple modes (best graphics, best performance, lowest energy consumption, ...), there are multiple vectors involved in defining the quality of a product.

Some of them being : stability, performance, security, costs, available documentation, technological debt, etc.

So yes, unless the question is precise, and the context is clear enough, "What's the best way of achieving this?" type of questions will lead to opinion-based answers.

2
  • 15
    The criteria is the key here indeed. If the post specifies what's "best": execution time, memory use, development time, portability, safety etc etc then the question is fine. If it doesn't, then it is probably a bad question.
    – Lundin
    Commented May 2, 2017 at 13:58
  • 4
    @Lundin agreed. "best" with a given metric = not opinion based. "best" without a metric is ambiguous. Ambiguous questions aren't a good fit for SO. And the ambiguity leaves the answerers to make the decision as to which metric(s) are important; hence, opinion-based. Commented May 2, 2017 at 15:33
12

As the saying goes, the only absolute truth is that there are no absolute truths. You can consider these catch-phrases as indications that a question may be opinionated, but they don't of themselves make the question opinionated. More often than not, I've seen people simply say this off-handedly. For example, "What's the best way to trim a string?", means simply "I need to know how to trim a string." The "what's the best way" is a colloquial added either for no purpose or because the user recognizes they don't have enough knowledge in this area to determine "good" vs "bad" ways for themselves. In either case, the answer is not really "opinionated". Most languages have a Trim (beit Trim, trim, strip, etc.), so here the "best" way is simply the way.

The best method to determine whether a question should be closed as opinionated, is to imagine how you might answer it. Is there a way to give an answer that is complete and satisfies the objectives of the question? Or, would your answer be wishy-washy, providing multiple routes or options to accomplish the same end, with no clear "winner". If the latter, then it's probably opinionated.

3
  • 1
    +1 because of your first paragraph, but I disagree with the second. I mean, consider your trim example for a language that doesn't have such a library function. Would you then declare the question to be off-topic? In that case, how could an asker know beforehand whether their question would be off-topic? Just as it's perfectly fine to answer the question "How do I ___?" with "You can't, but ___", it's also perfectly fine to answer the question "What's the best way to ___?" with "There's no one clear best way, but you can ___".
    – ruakh
    Commented May 3, 2017 at 19:06
  • The broader point of my answer was that you can't just jump on any one thing and say "Oh, that's definitely an opinionated question". The trim example, was a counter argument to show a case where an answer to a "best way" question could still be objective. That there may be languages that don't have that particular function is beside the point. Commented May 3, 2017 at 19:10
  • I'm not disputing the broader point of your answer -- that's why I +1'd it -- but only your second paragraph. The fact that there are languages without trim is exactly my point: if such a question is on-topic (and I believe that it is), then it is on-topic no matter what the answer turns out to be.
    – ruakh
    Commented May 3, 2017 at 19:28
5

No.

There are 10 types of questions with "the best way":

  • too broad, this has nothing to do with "the best way", they are just broad (and should be closed) and OP simply adds more broad-ability using that combo;
  • where "the best way" also imply certain optimization (often this is omitted, you are welcomed to guess giving own answer as long as it differs from existing).

binary 10 ;)

The very basic answer would be the straitforward solution to the problem. But then linq one-liner may replace several nested loops and is more readable. Then someone else may read this "the best way" as performance request and there could be indeed some nice solution with asm inline to make it lightning fast (or perhaps utilizing some technology). Other find a way to avoid memory allocations, etc.

So while "the best way" is a noise (you can remove it, similar to greetings), it may mean something to OP and the best is to simply ask in comment what they mean as "best".

Either answer have rights to exists (assuming they differ or add some value). Most of problems can be solved differently, does this fact makes all questions broad? No. Does "the best way" does? Maybe, but that really depends on the question. Keep reading it!

4
  • 9
    There are 10 types of people in the world: Those who understand binary and those who don't and those who didn't realise this was a joke about the ternary system.
    – DavidG
    Commented May 2, 2017 at 15:36
  • I strongly agree with, "simply ask what they mean by best" for most questions like this that I've seen, in my short time here. Unfortunately I find the rest of the comment hard to understand because it seems poorly proof-read. For instance straitforward is a mis-spelling with an obvious correction, but what do I do with the unfamiliar linq shortly afterwards? On this site, how many things could it mean? Commented May 3, 2017 at 8:06
  • I took a long time to parse this "the best way" performance request and it threw a "bad style" warning then an "expected: article" error on my mental console. +0 so far but I'm looking forward to the next iteration. Commented May 3, 2017 at 8:06
  • There are 10 types of people in the world: those who don't understand the joke, and those who are tired of hearing it.
    – Darren
    Commented May 4, 2017 at 21:29
5

I would tend towards "No". "What's the best way?" questions are usually asking a short-hand form of "I don't know very much about this particular aspect of this field, and I have a problem which I don't know how to solve, and I'd really like to know at least one really good way to do what I'm asking, and if there's a generally considered best approach to doing this, I'd like to know that first, and the reasons that it's considered very good, including possible tradeoffs"

Any answer that is well considered, appropriate and useful to the asker is not going to be mechanically yes or no in all cases, though.

Ironically, this post itself is possibly asking for a mechanical (ie "always true" or "always false") answer to what the best way to answer best way questions is, and is itself therefore engendering opinionated responses! :)

4

Generally speaking, yes. The vast majority (speaking as someone with a LOT of close votes) are of the po-TAY-to vs po-TAH-to variety. Questions about best practices fall into this as well. Since there's no objective answer, the question just attracts more and more answers.

The edge cases are where the OP is asking an otherwise objective question but adds What is the best way? somewhere. How can you tell the difference? If the question can be edited to remove What is the best way?, and still present a coherent question, then just edit it to remove the opinion parts.

3

I guess it depends on the context and how the question is phased.

There may really only be one 'best' way to do things in a given scenario or context.

the best way would be different for different scenarios even for the same functionality - like a time sensitive modules; one-man projects vs large team projects; security considerations; readability vs deliberate obfuscation; speed vs memory; etc.

so if the question is specialised and detailed enough, then there actually is very few "Best way" to go about coding it.

3

I don't know about opinion-based, but questions asking for "the best way" are always experience based. Answers stemming from experience are among the most valuable on SO.

The problem is that right now, I can't solicit experience. Asking for best practice will likely get my question on-holded.

And on the other hand, if I come with a concrete problem with a certain method, people will often come and question my method instead of trying to help me with my question. They might assume I'm suffering from the XY problem. Any way, I'm going to get told a lot of best practices - which can be great, but also annoying!

This leads me to actually lie when asking questions. If I want to know a best practice or get a tool recommendation, I pretend to be ignorant and describe doing something inadequate. And if I don't want to get advice, because I know what I'm doing, I have to write a lengthy disclamer.

Q: "Ohh I'm having a hard time opening this can with a rock"

A: "The tool you are looking for is a can opener!"


So if we robotically conclude "question X is opinion based → opinion based questions are bad → question X is bad", we miss out on some great answers, and force our users to go through contortions to get useful advice. I would wish for some more nuance here.

3

The specific question you link to

The question you highlight is clearly off topic. It is very unclear, without much to go on so far as providing an answer. A guess may be possible, but that is usually undesirable.

"Best" with regards to Primarily Opinion Based

Don't get hung up on one word, focus on the actual issue presented.

The best answers contain expert opinions. Informed opinions forged from someone who is

  • experienced
  • having, involving, or displaying special skill or knowledge derived from training or experience source: Merriam-Webster

The close reason for opinionated specifically states

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise.

Which inherently means that if answers to the question would primarily include facts, references, and examples that demonstrate specific expertise then the question was on topic.

2

Not always. The best way to do something can have measurable properties. A lengthy and resource intensive code that is inflexible is generally going to be considered inferior to one that is short, quick/intensive and flexible(eg with inputs).

Real World eg Lunar Orbit Rendezvous was the best way to get men on the moon, because it was the most efficient in terms of mass to orbit and mass to lunar surface. It wasn't necessarily the "best" in terms of safety or simplicity.

These parameters can yield very different "best" answers. The "best" route to the store might be judged by speed, by avoidance of traffic, or by the most scenic route - which could be three very different answers.

2
  • 2
    You've just given a fairly compelling argument for why "best" is subjective, because it can mean so many different things, and so there is no unambiguous "best" option; one needs a rigid set of criteria as to what "best" means to get an objective answer.
    – Servy
    Commented May 3, 2017 at 18:52
  • You've a good point. That was why I qualified my answer with "Not always." Some things are very subjective, some can be judged by various measurable parameters. I would also argue that "opinion/subjective" is variously different than "depending on how you judge it" based on objective facts. I've found some of these discussions about the characteristics of different methods and solutions to be very valuable (when they're based on reason/fact), and hence very much appropriate for this site, Commented May 3, 2017 at 19:07
2

Personally, I would say the answer depends on exactly how they asker defines "best", and how much effort they put into researching it beforehand.

  • If they just want to know what the "best" way of doing something is, don't say what they mean by "best", and don't show evidence of any research, then it's probably off-topic.
  • If they clarify what they mean by "best" (most efficient, easiest to maintain, most compatible with other programs, least likely to fail in unusual circumstances, etc.; "most readable" might count here, but it could easily devolve into purely opinion-based), and show that they've done research on their own (such as comparing solutions they're aware of, for example), then it should be possible for someone familiar with most or all methods to give a definite answer.
    • Note that if their definition of "best" is "most highly-regarded", or something similar, then it probably still counts as opinion-based.
    • If they explain their requirements very specifically, then it's more likely that it'll be on-topic, as long as these requirements can be used to disqualify potential solutions.

Basically, as long as they can clearly state exactly what they're looking for, so that it's possible to compare solutions in terms of how well they meet the requirements, and show that they've actually put effort into determining the answer themselves, then it should be possible to give an answer based on more than just pure opinion (e.g. "most efficient" gives the ability to perform concrete tests, and "most compatible with other programs" can be empirically judged). Otherwise, if there's no way to disqualify options, it's probably opinion-based.

-3

Yes, they are.

Because Stack Overflow and others SE sites are about answering well-scoped problems (that apply to you, but that others will meet too).

"What is the best way of doing something?" is a general question with answers that may not apply to the problems you will meet later on neither the users that will read it afterwards.

So if you want to be on-topic, have a proper answer, be more specific, and give your requirements, they can be light, but still getting you question better scoped:

  • Version of language if any (Python 2/3, Java, C#, etc.)
  • Native, no library, with one library
  • Focus on performance (like apply something for a thousand objects without taking too much time and consuming lot of memory because of unnecessary cloning and so on), focus on readability
  • ...

And don't forget to show us what you tried so far, tell us what you think is good, and what you think is bad so people will be able to give you a proper answer for your problem.

Along the same line: https://softwareengineering.meta.stackexchange.com/questions/6967/best-practices-bad-patterns-good

-6

I think phrasing "what's the best way" vs. "how can I" makes no difference, because every answer is the respondent's opinion on the way they think you should address the question.

Now there are questions that are overly broad and those should be called out. But that's a different issue.

I recently had a question about the best way to do background processing in a logger. Now to the question "how can I", there are 3+ legitimate answers. But the question "the best way" pretty quickly zeroed in to use a thread - with no async/await.

So yes, asking for the "best way" is generally a good idea. And if you're opposed to that, in my opinion, you're in favor of sub-optimal solutions because they meet the criteria of "they work".

Take a look at this question, which is a very useful question in my opinion. And clearly over 2,000 others think it's a useful question. That asks "what's the best way..."

6
  • 1
    You're debating semantics here... Of course users are asking for the "best" solution, but explicitly asking for "best" is just inviting opinions.
    – Cerbrus
    Commented Oct 17, 2023 at 13:43
  • 4
    The phrasing does make a difference, "best" in what way? Readability? Execution speed? Memory efficiency? User friendliness? There are so many ways best can be interpreted, if you are looking for the "best way" you should be a bit more specific. Commented Oct 17, 2023 at 13:46
  • @Cerbrus Yes it is. And I want your opinion on what the best solution is. I much prefer that to give me a solution that might not be best. Commented Oct 17, 2023 at 15:48
  • @AbdulAzizBarkat very good point on what constitutes "best." And that should be asked and answered. But that holds for "any solution" too because what matters to me could rule out some "any" solutions. Commented Oct 17, 2023 at 15:50
  • 2
    Stack Overflow is not here to host opinion polls, or questions where every answer is equally valid. See stackoverflow.com/help/dont-ask. Questions exist to help us build a knowledge database that will be helpful to others in the future (not just for the asker). For that to work well, answerers have to be able to predict what candidate answers will be acceptable, and voters have to know what criteria or requirements to use to evaluate proposed answers. That is why we expect and require questions to be explicit about the requirements and criteria.
    – D.W.
    Commented Oct 17, 2023 at 17:48
  • @D.W. You're creating a straw-man argument. As Cerbrus said, every answer is what that responder thinks is the best solution. It's their opinion. Only an incredibly arrogant person would think their answer is the only correct answer. Commented Oct 17, 2023 at 23:57
-7

All questions are Primarily Opinion Based

This is just silly pretensiousness from experienced users that we accept. There is no grounding for this.

  • What is the best to get started in fishing?
  • How can I get started fishing?

One of them leaves the questioner more vulnerable to attack by those that are pretentious. Both questions can be answered the same way, here are two examples,

  • Fashion a stick out of Eastern Cambodian bamboo and affix graphene string to the end of it allowing ample slack on the other end. Attach a baited hook nearest the side attached to the rod. Cast the rod to and fro attempting to get the baited hook further away from you while still in the water. Reel the baited hook in by pulling the slack taut on the rod.
  • Buy a fishing pole from the store. Any setup will work, you're learning. Bait the hook at one end and try to cast it into the water moving it around occasionally so the fish bites the bait. Pull it in and try to get a fish.

One of them speaks to a complex and esoteric method that is undesirable. However you phrase the question, that answer won't be chosen or upvoted.

It's even more silly if it's more concrete.

  • What is the best way to add two integers in Python?
  • How can I add two integers in Python?

It's technically a valid answer to pull out nasm and write assembly, generate a shared object, and link it into cPython or call it from FFI. But you're way in the weeds. Again this is just to show you the answers don't change with "best way" and the question itself isn't less valuable because of the style of wording chosen. All people want the Best Way.

"Best Way" is just filler words. It's like picking on a stuttering kid (except here it's likely a new user). If it really bothers you can just crop out extra words. You have a license to do that all the time. But **I wouldn't ignore the message nor let it distract you from the substance. Further, it's not worth even reprimanding a user for it doesn't matter.

-9

No. Sometimes the 'best' way is indeed the most efficient, most readable, and most logically coherent means to an end. And it just takes one of us Stack Overflow types to point it out.

3
  • 12
    Yes but who's qualified to state they have the best way? That is where the very nasty opinions come in.
    – Gimby
    Commented May 2, 2017 at 13:29
  • 4
    readable and logically coherent are usually still very much an opinion. Commented May 2, 2017 at 13:41
  • Most readable and coherent are opinion at best. Most efficient and fastest are almost always best tested by the OP (i.e. not on SO.) There may be some specific situations where speed of something makes a good question, but they are few and far between (e.g. Why is it faster to process a sorted array than an unsorted array)
    – DavidG
    Commented May 2, 2017 at 15:26

You must log in to answer this question.

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