13

We all know what the problems with most "best practices" questions is. Quite Often, it is spotting a herd in the distance and going trotting off after it. The other problem is that they can often be too broad.

But what, after all, is a site like Programmers all about, if it's not about best practices? Surely that's what we're all here for: writing better code.

This morning, we had someone stumble over the Why is asking a question about best practices a bad thing? So instead of asking a question about bad practices, he asked one about statistical usage of techniques.

Uh, oh.

So, rather than discuss more legalistic ways to screen out "best practices" questions, I am now asking: what elements need to be present in a "best practices" question to make it suitable for Programmers?

In particular, I'd like to see more question and answer pairs of the form: "This practice is preferred because [well-thought out reasons here], and this practice is discouraged because [sensible rationale here]."

  • I am the programmer who posted the question noted here. In my opinion, this is a mischaracterization of my question. I don't care about best practices. In fact, I spent days investigating the issues and coming to my own conclusion before asking my statistical question. Even if the statistics were opposite my conclusion, I would not consider the commonly-used approach to be a good practice. (For the record, Microsoft MUI stinks.) Nonetheless, after my days of effort, I have no idea what is standard practice. This is a very different question from my wishing to know best practice. – Dan Nissenbaum Jan 5 '15 at 18:24
  • 1
    @DanNissenbaum: Perhaps the 90% of the people who use Microsoft MUI did so because they were trotting after the herd. Doesn't necessarily make the technique a good one, just one that is used because that's what everyone else uses. Or, maybe it was the first technique that was available. The why is still more compelling than the usage numbers. – Robert Harvey Jan 5 '15 at 18:24
  • FYI, here is a link to the post noted in the question (I wrote it): programmers.stackexchange.com/questions/268090/… – Dan Nissenbaum Jan 5 '15 at 18:29
  • Robert - In regards to the 90% point that you raised - I agree. In fact, as I stated in my post, if 90% of people used MUI, I still wouldn't use it. As I stated, I am not basing my choice on the statistics. You are trying to herd me into a hole in which I, and my question, don't fit. – Dan Nissenbaum Jan 5 '15 at 18:30
  • 1
    Then what are you asking? Clearly, you don't need the research, since you've already done that. – Robert Harvey Jan 5 '15 at 18:31
  • Robert - If you look at the title of my post, and read my question, you will see what I am asking. I have no idea, on Windows, whether GetText is commonly used. I'd like to know. In my case, I stress that I am not basing my decision on this, and in particular in my case, I am not asking about best practices (even though it might appear so on cursory reading.) – Dan Nissenbaum Jan 5 '15 at 18:32
  • 2
    I would consider any question about market share categorically off-topic here. – Robert Harvey Jan 5 '15 at 18:35
  • 1
    Robert - I didn't ask about "market share", and it's also not particularly related to "best practices", in my opinion. Here's a question, which in my opinion gets to the heart of whether the question I asked belongs on this site: Suppose you had a challenging task and spent days researching two technologies in detail, finally coming to a carefully considered conclusion, but aware that you had no hands-on experience implementing either approach. Suppose you then learned that 100,000 people used one approach, and 0 people used the other, in your use-case. Would that cause you to reconsider? – Dan Nissenbaum Jan 5 '15 at 18:42
  • An interesting, but ultimately irrelevant straw man, and a hypothetical one at that. – Robert Harvey Jan 5 '15 at 18:43
  • Robert - if you think that is a straw man, than what do you think my question on Programmers is? It is exactly that straw man! That's what I actually want to know. Or do you think my question is hypothetical, or that the answer is obvious in the case I'm asking about? I have an actual question I'd like answered! I have absolutely no clue what the standard practice is via MUI vs. GetText. I've made up my mind already, but I want to know if I'd be one of the first ones to do so. – Dan Nissenbaum Jan 5 '15 at 18:45
  • 1
    You can spin it any way you like, but ultimately your question amounts to "I've made my decision, unless x number of people use this over that." The reason why is still the compelling factor, not the numbers. – Robert Harvey Jan 5 '15 at 18:46
  • Robert - I note that you did not answer my question. In my example, would it cause you to reconsider if you discovered that 100,000 people used Technology A, and 0 people used Technology B, in your particular use-case, after you had decided upon Technology B after careful research, but had no experience with either? I'd like to know your thoughts. – Dan Nissenbaum Jan 5 '15 at 18:48
  • 7
    Best Practice is to not use the word "Best practice" on programmers.stackexchange. – Johan Jan 7 '15 at 0:26
  • 1
    @gnat: your comment sounds like a good answer. – Doc Brown Jan 13 '15 at 14:48
  • 5
    So this is a question asking for best practices when asking a question about best practices? – Cody Piersall Jan 19 '15 at 17:32
8

I disagree quite a bit with Thomas Owen's answer. The last thing I want to do is answer the same question a dozen times because there are dozens of variants of scenarios where the best practice applies. And as someone searching for answers, I don't particularly care about someone else's specific situation because I've been coding long enough to know that I am not a special snowflake. My situation isn't that special situation where God objects are okay.

Most of our question askers and answer searchers do not know that though. And we would be doing them a disservice if we didn't dissuade that thinking. Frankly, I would much rather have a horde of zombies clamoring towards something that will work in 80% of cases than a horde of zombies striking out randomly. The people who will know to effectively adapt other people's situations to their own are already the people who can take general best practices and adapt them to their situation...

To me, the key problem is that there needs to be a single answer. Too many things don't have best practices that apply widely to all languages/problems/environments, or don't have programmer consensus. These should probably still be closed.

But there are plenty of things with clear cut best practices that we still close, that I feel are on-topic and helpful.

4

Just because a question contains the words "best practices", IMHO it is not always the case that it "refers to the technique that works for most people in most situations", as Thomas Owens wrote (nevertheless I think his answer is very good). One has to read and understand the full text of the question, check if the author makes reasonable restrictions to the scope, and if he has a real-world problem to solve (and if not, the question should be closed, of course). So asking a question like

I am in situation X, having problem Y and no clue how I can solve it. What could be the best practice to approach a solution?

can be fully acceptable. I think what @gnat wrote in a comment above hits the nail on the head - try to imagine how the question would look like with "best practice" words removed. I think that is a good test.

Furthermore, I think that a too specific restriction of the scope to a personal situation of the author decreases the value of a question as much as a too weak restriction of the scope. For example, by restricting something to a specific programming language when the problem itself is not language specific. Good answers can be applied to a wide range of cases, thus questions which define enough restrictions to be answerable, but not more, can actually encourage such answers.

TLDR; it depends, there is no "simple criteria", taking the time to read and understand what the author asks is the only valid way to make a decision.

EDIT: due to the comments - yes, it is true, "best practice" has become a buzzword, often triggering a "close reflex". So my suggestion is: when a question passes the test that it still looks good with the "best practice" words removed, those of us who have enough rep to edit the question should consider to rephrase the question slightly, avoiding the buzzword.

  • So, to loop back to OP question, it seems like including "best practice" doesn't automatically invalidate a question, but rather all the usual practices for improving a question apply. Seems like adding "best practice" used as a buzzword is just "not constructive". – Rob Jan 13 '15 at 17:08
  • 1
    @RobY those who invalidate automatically, by keywords trigger, fall in the very trap warned about in canonical post referred in this question: "spotting a herd in the distance and going trotting off after it" – gnat Jan 14 '15 at 9:22
  • 2
    @RobY: see my edit – Doc Brown Jan 14 '15 at 9:33
3

On questions with problems

A question without a problem to solve, and just casting the net for "best practices" doesn't have a problem to solve. That's rather tautologic, but that is the problem with the questions without a problem. You can't ever solve them.

The actual best practices (and not things that one mindlessly copies and pastes into documents for management, or tosses out in a meeting as an appeal to authority) are ones that become evident when solving a problem.

Thus, the answers themselves to a question that has a problem will be the best practices to solve that problem. So ask the question about the problem and you will get the best practices.

Blindly following best practices is, at best, an anti-pattern (for those who like to go with patterns and anti-patterns). As with how patterns are meant to be used, you use them when you encounter a problem - you don't just take half a dozen patterns and toss them together to get an application. Likewise, with best practices you should use them when you need to.

Asking for "what are the best practices for writing an Android application" is very much the same question as "what are the patterns you use for writing an Android application" - both are too broad and not useful to other users (there are dozens of patterns and best practices - and dozens of possible answers).

On problems with answers

The other half of the problem with asking for best practices is the quality of the answers. This isn't so much a problem with the question other than it encourages such answers.

When someone asks for best practices, everyone chimes in. This is often exacerbated by having the question show up in the hot questions which magnifies the problem with answers.

What is the best practice for XYZ?

Which leads us to get answers like:

At my shop, we avoid doing X.

At my shop, we avoid doing Y.

At my shop, we find that X and Y are both essential to the proper workings.

Z is always problematic when you are working with ABC.

The very nature of those answers is forum like and brings with it the problems of forums. You get lots of answers that don't have a single answer. It is too broad and laden with opinions.

Now, I admit the straw man above and its quite possible that the answers will be better than the ones above. But they won't be as good as actually presenting the problem to be solved and having those answers.

A takeaway of Optimizing For Pearls, Not Sand is that while poor questions can produce great answers we really need to try to have questions that lead to great answers from the start.

That’s why we’re determined to keep question quality high, even at the cost of refusing a little sand. It’s true that you can’t have Q&A without questions, but having the wrong sorts of questions is far more dangerous. The fastest way to kill any Q&A site is to flood it with low-quality questions.

When you get dozens of poor quality answers in a question (such that asking for best practices can easily produce) the quality of the site suffers. The signal to noise ratio goes down. And whats worse, the way to fix this is easy - don't ask about best practices in the abstract - ask about the problem you are encountering.

  • See Does using == in JavaScript ever make sense?. Compare with Are there real-life usage and applications for “do while” loops?, which was closed as "Too Broad," but essentially only has one answer. Granted, it might have survived had the op not insisted on making the question a laundry list. – Robert Harvey Jan 6 '15 at 18:23
  • 2
    @RobertHarvey my (and I suspect other) close vote on Are there real-life usage and applications for “do while” loops? was based on the polling aspect of "Have you seen real-world applications of the do while loop construct? In what way is such a construct, in your example, advantageous over for or while loops, or any other constructs?" the question you asked isn't a poll but a question of language design and the applicability of a particular operator. – user40980 Jan 6 '15 at 18:28
  • A question without a problem has a problem, so we should solve the problem with the question so that we can answer the question in the problem. Either way, someone has to do something. – user251748 Apr 3 '17 at 19:22
2

Taking off on Thomas Owens' excellent answer, it seems to me that a way to ask a "best practices" question is to ask a "better practices" question.

That is, I have this problem (in this environment). Here's what I've done to (try to) solve it, and here's why my solution, X, isn't satisfactory. I've also looked up the answers to questions A, B, and C on the site, and those answers don't quite work for me either. What would give me better results than my solution X, and the answers to questions A, B, and C?

If someone can come up with something better than the "above," that would be a start on the road to a solution. And hopefully there would be several answers, all trying to "top," the others, with the "best" (most upvoted and/or accepted) solution being the "best practice."

As I see it, we're not out to find "best practices" in isolation, but rather, "best practices" for the users of this site.

1

When someone says "best practice", they are referring to the technique that works for most people in most situations. That's really not appropriate for Programmers, I don't think. Instead, we should be focused on solving a particular instance of a problem. Instead of asking for a best practice, it should be focused on the individual's situation. Any question asking for a solution should describe the current environment in terms of people, processes, technology, and available tools. Depending on what the environment offers, there are likely to be different best options.

Because of this, I'd want to see more linking between questions here as indication that you've searched at least this site to find similar situations and why the accepted/top answers there don't work for you.

There are likely to be other characteristics as well, but for me, those are the three big ones:

  • A clear description of the problem.
  • A clear description of the environment.
  • Similar questions or posts and why they aren't helpful to you.
  • 2
    Such questions answer pairs are more useful to the person asking the question, but arguably less useful to others coming to the site looking for general information about, say, why Angular is preferred over Ember. Yes, such questions tend to be too broad, but we often discard them simply because they are X vs Y, rather than meaningfully evaluating their scope on its own merit. If they can get us halfway there by showing us their research, obviously that does help. – Robert Harvey Jan 5 '15 at 18:34
  • @RobertHarvey I'm not entirely convinced that it is less useful to others. Of course, it would require looking at more than one question/"answer set" to determine what you should do. I think that may be the nature of Programmers, though, is that we may be slightly more geared to helping everyone by helping individuals. Assuming that answers are high quality answers that explain themselves, people could begin to draw conclusions as to what the best thing for them to do is. – Thomas Owens Jan 5 '15 at 18:43
  • 1
    I guess I'm trying to find a way to describe "best practice" questions on Programmers for new users to understand. As it currently stands, Programmers is not a good source for general knowledge about Angular (or anything else), because the questions that would capture such knowledge are excluded. I'm not yet prepared to accept the idea of "general knowledge via a thousand angels dancing on the head of a pin" just yet, and surely all questions on Programmers are about best practices. – Robert Harvey Jan 5 '15 at 18:50
  • 3
    There are no such things as "best practices". See here, here, and here. There is only a solution to your problem in your context. By doing research, some people can develop their own ideas. Others may need to ask a new question (demonstrating that they have done research). – Thomas Owens Jan 5 '15 at 19:13
  • 2
    The problem is that the help center describes PSE as a place to get "answers on conceptual questions about software development". Conceptual questions, by definition, have independence from a specific situation. So tightening the requirement for specific context, undermines the reason for PSE in the first place. The problem is, experienced users know how to dodge the third rail(s) and ask the conceptual questions so they don't get downvoted and closed, but new users tend to get bitten by it. – Rob Jan 5 '15 at 22:10
  • 1
    @RobY per my reading of the dictionary definition it doesn't look like conceptual questions have independence from a specific situation: "based on or relating to ideas or concepts..." – gnat Jan 5 '15 at 22:32
  • 1
  • 1
    @RobY I fail to see how ideas have freedom from specific situations. Particularly in the light of an established and widely used method to explore ideas based on the analysis of specific situations (case method) – gnat Jan 6 '15 at 10:14
  • 2
    @ThomasOwens: Well, generalized "best practice" (or better practice, or whatever you want to call them) questions are clearly possible, so the question becomes: "What makes a good best practice question good?" or better? – Robert Harvey Jan 7 '15 at 1:45
  • @gnat maybe that semantic discussion would be better for "english.SE" ;) – Rob Jan 13 '15 at 17:04

You must log in to answer this question.

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