22

Motivation

I have been seeing lots of "best practices" questions in the , tags recently on my front page, some years old, out of date when they were written and people answering them with their opinions years later.

So I got curious and did a search and examined the first 50 questions of a couple of tags I am active in. I could not find a single one that was not full of opinion based discussion and rambling that was either worst practices when it was written or just plain misinformation from then and now.

Off-Topic for multiple reasons

Why these are inherently poor questions is well documented

When you look at the answers you can see many are just recommendations questions in disguise at best. Best Practices is inherently opinion based and temporal even when there is consensus on a single opinion.

Best Practices questions worded where they fall afoul of the spirit of these 2 guidelines should be closed for any one/all the reasons above.

Best Practices change over time! They are all off topic in one or more of the following reasons asking for recommendations, too broad and opinion based.

In almost every case there is no code either, that is another off topic strike.

Best Practices != Idiomatic

If a question with Best Practices in the title is actually about something more specific then the title needs to be changed. If it is about idiomatic code, that is probably on topic. Best Practices is at best, argumentative opinion. Idiomatic practices are empirical by ubiquitous consent by adoption and/or usually codified somewhere ( Python PEP 8 and 275 comes to mind ).

Best Practices questions implicitly are asking for your favorite. Idiomatic questions are asking for what makes something standard based on the published or agreed upon standard, which is an empirical answer that can be backed up with evidence. You opinion on whether the idiom is a best practice is an entirely different opinion based subject.

An example is accessor methods in Java Beans, getXXX/setXXX methods are idiomatic Java. They are specified in the JavaBeans standard. Now if they are a best practice is arguable.

Straight from the "Don't Ask" page in the Help Center:

If your motivation for asking the question is “I would like to participate in a discussion about ______”, then you should not be asking here.

Regardless of intent these questions also generate lots of discussion. So they are implicitly asking for discussion of everyone's opinions. They all devolve into a you are wrong argument between two opposing camps. When most likely both sides are wrong, especially if I disagree with them both. ;-)

To prevent your question from being flagged and possibly removed, avoid asking subjective questions where …

every answer is equally valid: “What’s your favorite ______?”

your answer is provided along with the question, and you expect more answers: “I use ______ for ______, what do you use?”

Every Best Practices questions is a "What's your favorite ____?" question or it is an "Whats idiomatic?" question that needs the title changed.

Many show what the questioner is doing and asks falls afoul of the second guideline. "Here is what I am doing, is this a best practice?"

Migration

Some of these might be on topic at Programmers because they are about programming and are subjective but in scope there, but getting things migrated there is an act of futility in most cases.

Take Action

Who wants to help edit/close/migrate these questions as appropriate? or at least edit Best Practices out of the titles and replace them with better titles?

At the least these are just "tagging in the title" and that should be discouraged if nothing else.

Some of the higher rated ones that just have a bad title are probably good candidates.

And just to be clear, I used the tag as a strawman. If you are not active in , please feel free to take a shot at cleaning up the tag that you do have relevant activity in.

###Feature Request

We do not allow as a tag. I think we need to prevent it from being a title as well.

17
  • 7
    Trying to think of a counter example for a legitimate use of "best practices" in the title here on SO, but I can't think of any. I can't come up with a title that absolutely needs those words without being too broad/opinion-based. +1.
    – ryanyuyu
    Commented Dec 9, 2015 at 15:13
  • 2
    Only argument against this is that allowing it in the title makes it easier to find and fix/close these types of questions. (Often, the title isn't the only thing wrong with them.)
    – BSMP
    Commented Dec 9, 2015 at 15:15
  • 5
    related: Why is asking a question on “best practice” a bad thing?
    – gnat
    Commented Dec 9, 2015 at 15:24
  • The only counter example would be a question that can be modified to not ask for "best practices" and not change the intent.
    – Kevin B
    Commented Dec 9, 2015 at 15:56
  • 3
    Please don't. I like it when I can tell that there is no point in looking at a question. These ones yell "waste of my time" from fifty feet away. Banning words in the title does absolutely nothing to prevent such questions from being asked anyway. Commented Dec 9, 2015 at 16:01
  • 19
    I'm not a huge fan of outright blacklists for titles after the porblems we've had with them in the past: meta.stackexchange.com/questions/161398/… . I've also seen a number of questions asking for best practices when referring to a specific set of options for how to do something. These aren't too open-ended or opinion-based, and can have specific factual answers. I don't think all of these need to be closed.
    – Brad Larson Mod
    Commented Dec 9, 2015 at 16:03
  • 3
    'best practices' is a welcome distraction from the more usual wars over religion, politics, sexuality and tabs/spaces. Commented Dec 9, 2015 at 16:04
  • 3
    @BradLarson Most questions that ask for the "best practice" to do something are either too broad or opinion-based. If a question that asks for a "best practice" is neither, then the term "best practice" is used vacuously and could be edited out without changing the meaning of the question (e.g. "What is the best practice to foo the bar?" could become "How do I foo the bar?") Or it has a specific meaning that the OP has obscured under the term "best practice". Again, it could be edited out in favor of an expression that reveals the specific meaning that the OP had in mind.
    – Louis
    Commented Dec 9, 2015 at 19:08
  • 4
    @HansPassant - that is what down votes and close votes are for, to tell you that things are not worth your time.
    – user177800
    Commented Dec 9, 2015 at 19:36
  • 1
    chances for this stuff to find home at Programmers are rather slim: What goes on Programmers.SE? A guide for Stack Overflow
    – gnat
    Commented Dec 9, 2015 at 19:50
  • 4
    @pnuts - excel best practice. Go for it!
    – user177800
    Commented Dec 9, 2015 at 20:05
  • 1
    @pnuts - editing the titles of these things can only be a Good Thing™
    – user177800
    Commented Dec 9, 2015 at 20:09
  • 1
    @pnuts oh god...
    – Braiam
    Commented Dec 9, 2015 at 20:21
  • 'nuff said
    – user4639281
    Commented Dec 9, 2015 at 20:34
  • @BradLarson So banning words in the title is not a best practice? ;)
    – Machavity Mod
    Commented Dec 11, 2015 at 13:25

3 Answers 3

20

Alternate Proposal

How about anything with Best Practice(s) in the title get a pop up warning that the words are most likely to get the question closed as off-topic with a link to the discussions on meta about it.

If they insist

Then the question gets shuffled off to the Triage queue and/or Low Quality queue immediately so it can be dealt with effectively and as rapidly as possible.

9
  • I remember that there is a warning about title with "best".
    – Braiam
    Commented Dec 10, 2015 at 4:31
  • 1
    If we do go this way of trying to prevent anything resembling a question leading to even slightly-subjective answers, probably a similar thing ought to be done for any question which has "should" in the title. I still think this is a shame -- outside of specific domains like gaming, graphics, database, networking, etc. and just general language questions, they often boil down to what is correct/incorrect ("What's wrong with my code?"), what's idiomatic in languages that encourage a strong aesthetic like Python (again B&W correct/incorrect), and best practice (most interesting one to me).
    – user4842163
    Commented Dec 10, 2015 at 14:18
  • 1
    This is not my opinion, this is the goal and specifically the site charter". TL;DR version *"You should only ask practical, answerable questions based on actual problems that you face. Chatty, open-ended questions diminish the usefulness of our site and push other questions off the front page." and avoid asking subjective questions where … every answer is equally valid: “What’s your favorite ______?” your answer is provided along with the question, and you expect more answers: “I use ______ for ______, what do you use?”
    – user177800
    Commented Dec 10, 2015 at 14:39
  • 1
    @JarrodRoberson Very true, but I'm coming from the standpoint of a rebellious nature who thinks the encouraged questions are leading to a wasteland of troubleshooting debugging-service Qs. :-( At least that's the perception I get from my favorite tags. I love those somewhat chatty answers with anectodes -- ultimately best-practices, like this one: stackoverflow.com/questions/1647631/c-state-machine-design/…. I look at a homework Q next to it and don't think it benefits from a pro/enthusiast touch or the voting system that much (it's rewarding speedy answers)...
    – user4842163
    Commented Dec 10, 2015 at 15:11
  • 1
    @JarrodRoberson ... the best practices one which draw on anecdotes and experiences is something which actually does seem to benefit from a genuine enthusiast or pro's touch -- it calls for experience rather than info we can simply extract from a google search, e.g. My favorite answers here often allow the answerer to cite himself.
    – user4842163
    Commented Dec 10, 2015 at 15:12
  • 3
    @Ike - except when the persons anecdotes lead to an incorrect conclusion on their part or the part of an inexperienced reader. See also: Dunning-Krueger Effect, thus one of the fundamental reasons off-topic: opinion based exists.
    – user177800
    Commented Dec 10, 2015 at 15:13
  • 1
    @JarrodRoberson Very true -- but I have faith in the voting system to help mitigate that. The results I see of what gets up-voted in questions that don't reward the FGITW are encouraging -- not perfect but not bad at all. Mileage might vary here -- you might not see examples as nice as I do.
    – user4842163
    Commented Dec 10, 2015 at 15:14
  • @JarrodRoberson The Dunning-Krueger effect is an ever-persistent danger in this format, but I think it exists even for answers that boil down to black & white notions of correctness, unless people only voted on questions which they knew for sure themselves to be correct or incorrect.
    – user4842163
    Commented Dec 10, 2015 at 15:18
  • @JarrodRoberson The interesting qualities I notice in paxdiablo's posts (they're all rather chatty), is an extreme amount of open-mindedness. His kind of anecdotal nature is always accompanied by a disclaimer that there might exist a better way. It's the precise opposite of dogmatism, and dogmatism is often one of the quickest ways to ruin an otherwise decent Q&A on something which relates to best practices, like a design-related question. But I love his style of posts -- they bring personal experience to the table, and I find it a shame that they're now discouraged.
    – user4842163
    Commented Dec 10, 2015 at 15:24
11

I must admit, I love best practices questions! I love what they do for the site with people competing to try to find the answer that clicks with the most people. It's where the voting system and the competitive nature of answering starts doing something interesting with respect to community approval, a radical difference from some question which can be answered by the fastest gun in the west.

Knowledge can be found by anyone knowing how to search for it. Experience cannot, it comes from personal practice.

Hopefully without casting a negative meta effect, I want to direct attention to this answer from dear paxdiablo: C state-machine design. It's a design question, definitely a subjective best-practices one, with an answer that rose to the top through a popularity vote. And pax's answer is filled with conjecture and anecdotes, it's far from a Spock-style dry technical precision answer. It's an answer that brings personal (and therefore subjective) experience to the table, it's an answer where the answerer is ultimately citing himself. And yet, isn't it wonderful? This is what I want from stackoverflow! I can do a Google search for many other things. I want to read the thoughts of experienced enthusiasts and pros about their experiences and what worked and didn't work so well for them. Isn't that one of the main things that experienced people can share -- what they personally (and therefore subjectively) found to work well in practice? Am I being too selfish? I've been coding for a very long time but I tend to see programming just as much of an art as it is a science, and that art side can't be so dry, so technical, that we can simply cite every answer and boil everything down to a simple SE metric. It is in those foggy cases where the popularity vote can actually help the most, to help navigate the art and design side of programming where there isn't a perfect black-and-white correct/incorrect distinction.

The highest-frequency question in the tag I often hang out in, , is this one: Do I cast the result of malloc?, which is effectively a best practices question. It seems like a double-standard when these questions are so popular among the community and we refuse to close/delete them while discouraging such questions outright yet nevertheless linking to such questions all the time.

And it does boil down to opinion, but even those who disagree with the accepted answer there on casting malloc results, which is a firm "no", can still find some decent rationale for why the answerer believes that explicit casting here has more cons than pros. It's probably among the most commonly-linked questions within the C tag with the community as a whole telling new people that they shouldn't cast the result of malloc. To understand why not, see that question -- the community approves.

It is a popularity contest at the end of the day, but that's true of the voting system in general. It's put to good effect when it rewards some perceived sense of "quality" beyond the first person to get a correct, routine answer.

It's hard to fake experience with a best practices question. The background of the answerer tends to show through, and a good answer can be put in terms of pros and cons which aren't too subjective. Whether we agree with them or not, interesting dynamics occur there. An advanced developer often doesn't struggle with correctness the first time around writing code, they often struggle with maintenance of large-scale codebases, they struggle not to become confused by the complexities of their own creation. Best practices becomes increasingly more relevant and interesting and starts to take the spotlight with increasing experience. At the very least, it tends to provide more informative reading material than a troubleshooting question which boiled down to the person using = instead of ==.

I would suggest going all the way to the opposite end, make it a tag! Then people know what they're getting themselves into when they click on a question with a best-practices tag. It might even have a tag description like:

All ye who enter, beware. This area contains subjective answers which may be out of date, hopefully backed by experience, but we make no guarantees.

We already have a lot of tags which are often fronts for best practice questions, like , , , and . I love these tags since they often present questions which are more challenging to think about and respond to than your average "What's wrong with this code?" homework question.

Best practices is a very relevant topic in programming even if it's not considered suitable for this site due to its chaotic nature. If best practices aren't found here, they might be found in a book written by some random author, from a team's standards, from some archaic boss, or just completely from a personal source. Yet it seems like a shame to take these out of SO, as SO does something a whole lot better than these other potential sources. It subjects any writings about best practices immediately and directly to a community-wide review process. I can't think of a better format for such a topic than one which has this raw and direct exposure to a voting system. It's flawed, as best practices always will be, but it's considerably less flawed in this type of format (unless we completely distrust SO's community voting to favor good answers in general, for which I must then ask, "what then is the point of a voting system and even SO in general if we don't trust the votes to align with good answers?").

With respect to the temporal nature of the answers, that's true but it's true of programming in general. Libraries and frameworks can become considered obsolete even more quickly than what is accepted to be a best practice. It's something to think about a lot, how this site is going to deal with outdated information in the future, but I think that's just a concern in general of just about anything except a language/hardware/OS/API-agnostic question about data structures and algorithms.

42
  • 1
    becoming obsolete is why recommendations are rightfully off-topic in addition to being opinion based as a secondary reason. These are just recommendations based on opinion even more so than frameworks and libraries recommendations.
    – user177800
    Commented Dec 10, 2015 at 12:51
  • 2
    @JarrodRoberson Lemme just tell you how I see SO. I see it as mostly a tech support site for beginners who don't know how to use a debugger. Boring -- the 10,000th segfault from someone who doesn't know what a debugger is. Questions about best practices whether they are about how to effectively use a language feature or a design pattern are at least interesting. They at least invite answers which require some time and thought invested into them. I'm mainly desperate for interesting material -- and a best practices question seems like an oasis in contrast to an MCVE Q from one who doesn't...
    – user4842163
    Commented Dec 10, 2015 at 12:57
  • @JarrodRoberson ... know what a debugger is while using a language as difficult and as dangerous as C or C++. It at least hits that pro/enthusiast exchange idea harder than "tech support" for people with homework.
    – user4842163
    Commented Dec 10, 2015 at 12:57
  • 7
    @JarrodRoberson My fear is that as we keep expanding the range of OT questions on the site, all we end up being left with for the most part are those homework troubleshooting questions from students who haven't learned how to debug basic code yet -- SO -- the perfect tech support debugging service site for beginners.
    – user4842163
    Commented Dec 10, 2015 at 13:01
  • @JarrodRoberson The other part I'm seeing and getting bothered about is the very obvious double standard. We don't flag or close questions like that hottest and most frequently-active C question I linked to above on whether to cast the results of malloc. Instead it became, and remains, the most popular C question on the entire site. I think at the very least we have to be consistent here -- if such questions are to remain in the database, they'd best be marked as such -- ideally with a best-practices tag. Delete it or tag it properly is my thought, at the moment it's just disorganized.
    – user4842163
    Commented Dec 10, 2015 at 13:14
  • there used to be a "What is a debugger and how do I use it?" dupe target in the java tag anyway. I can't find it now, not even deleted version. Those clueless newbie questions are all one or more of the "What is a NPE", "How to compare Strings?" or "How to use a step debugger?". At this point, all the interesting questions about any given tag have been asked dozens of times, until a new version with new features comes out anyway. All this is pretty much off-topic from this specific suggestion about a specific indicator of crap questions.
    – user177800
    Commented Dec 10, 2015 at 13:22
  • That C question should be made a community wiki page and closed and locked for historical purpose. The current bounty to update all the answers as they are out of date reinforces that this type of question is bad. This should have been done 6 years ago when it was posted.
    – user177800
    Commented Dec 10, 2015 at 13:32
  • @JarrodRoberson With that C one, there were some answers which were out of date even at the time they were provided. :-D They're citing 25-year old C compilers giving warnings without the cast. But yeah, there are definitely interesting questions outside of best practices. I'm just up to my eyeballs in those newbie questions in tags like c and c++ and I might see these best practices questions more favorably than usual because of it.
    – user4842163
    Commented Dec 10, 2015 at 13:33
  • 1
    @JarrodRoberson It does get quite a bit blurry though, don't you think? When we discuss the benefits of mixins, it's blurry with best practices. When we discuss what's pythonique, the very idea of pythonique code is related to best practices. Any mention of a design pattern is immediately in the territory of best practices. So much of this mental model of how we write code and even the benefits that some programming language provide relate to perceived best practices. It's hard to divorce ourselves from it completely in favor of Spock-like technical precision.
    – user4842163
    Commented Dec 10, 2015 at 13:35
  • 1
    Do not conflate best practices with idiomatic. There is a significant semantic different. For example Pythonic means idiomatic Python which is not really up for debate what falls under that term semantically. Design Patterns are debatable because they can be applied differently in different scenarios to varying degrees of appropriateness, thus debatable. Something that is idiomatic is not debatable, it has been settled.
    – user177800
    Commented Dec 10, 2015 at 13:40
  • 1
    @JarrodRoberson That's true, though what gives rise to idiomatic code? At some point was a best-practices kind of question, drawing upon experiences of devs in the field, and even at the time a new programming language is born. It might be overly optimistic of the quality of the voting, the popularity of the site, and the ability to reach widespread consensus, but I could imagine some scenarios where SO could give rise to new idioms or cement effective practices already applied provided that it has the breathing room to do it. My perception might be skewed...
    – user4842163
    Commented Dec 10, 2015 at 13:44
  • @JarrodRoberson ... I see best practices questions with very encouraging results in the areas I look at.. perhaps you see ones with more discouraging results.
    – user4842163
    Commented Dec 10, 2015 at 13:45
  • @JarrodRoberson I might also be biased as my primary language is C++. With C++, learning the language might take a year or so. Learning how to use it effectively might take 20 years and then some, never quite perfectly settled on how to use the language most effectively, always searching to do better. The knowledge there of how to use the language effectively is constantly evolving, with even the author of the language claiming there's more to it than we currently often think. To take out the best practices side there kills a great source of the constantly evolving knowledge of how to use it.
    – user4842163
    Commented Dec 10, 2015 at 13:53
  • @Jarrod Roberson Regarding outdated "best practices" - That is what the comment feature is for. It does not matter if a question is related to "best practices" or not. Answers eventually go obsolete. Period. (by the way, I +1'd this answer -- "best practice" questions are 95% of the reason I browse this site, just to correlate my own research with people that have field experience.) Commented Dec 11, 2015 at 13:52
  • 1
    How you see it and what the rules and charter of the community are diametrically opposed.
    – user177800
    Commented Dec 11, 2015 at 22:25
-3

I think there are definitely cases where a question with "Best Practice" in the title can be an appropriate question for SO.

Here are some examples:

Though these questions don't have "Best Practice" in the title, they certainly could have and the questions would have essentially been the same. Even good questions for SO don't always have just one correct answer. But it's also possible for "Best Practice" questions to have just one or two correct answers, and not just be a mountain of varying opinions.

Searching the javascript "Best Practice" questions:

These could have just as easily been asked as How to do function overloading in Javascript or How to encode a query string.

So really, it's just semantics for some questions. Questions that are truly just opinion questions will get closed as normal. If it improves the question, we could edit the title of these questions to use a non-Best Practices title.

11
  • 3
    one persons best practice is another's worst practice in the other persons opinion if they do not understand why they are incorrect. Take the practice of marking as many things final as possible in Java. Lazy people and those that do not understand the benefits do not find it a best practice, the thing reusing a method argument redefining 40 times in a method is a best practice because it saves resources or so other mis-informed crap. If there is a valid question then the Title needs to edited to reflect that.
    – user177800
    Commented Dec 9, 2015 at 19:16
  • 1
    See how I improved Best practice: escape, or encodeURI / encodeURIComponent it is much more semantically correct to the intent of the question and the confustion the OP has about the various functions and it will make the question more valuable to future visitors because it will hit more often when people are searching for the same intent. No in depth knowledge of the tag is needed in such cases. There is no good use case that makes it not off-topic in some way.
    – user177800
    Commented Dec 9, 2015 at 20:02
  • 1
    if your argument that its just semantics infers that the difference is small and is intended to be dismissive it is incorrect. The phrase is misused when people intend to say only that the difference in position is very small. It is also misused when just trying to dismiss the other as not being worth the bother
    – user177800
    Commented Dec 9, 2015 at 21:08
  • My main point of contention was the proposal to have an outright ban on "Best Practice" questions based on the title alone. I don't think that is a good idea. While some questions with "Best Practice" in the title are considered off-topic for SO, I don't see why they wouldn't be caught in the normal flag and review process, and why we would need to create a special case for them. And while renaming some questions might make them more clear, I don't agree that categorically renaming all "Best Practice" questions makes them better. Commented Dec 9, 2015 at 22:09
  • 2
    @Brendan disallowing keywords that specifically make a question off-topic is, IMO, very much better than just expecting that every question asked in that format will be found and closed properly. For questions that aren't actually about best practices but rather how to do something, they would no longer be closed incorrectly; for questions blatantly asking for opinion based answers, they would be stopped before they even made it onto the site. I fail to see how that is not a win-win situation.
    – user4639281
    Commented Dec 9, 2015 at 22:24
  • @TinyGiant Perhaps, but like I said, I don't think Best Practice is specifically off-topic, no more than Should I be using spaces or tabs? is specifically on-topic because it doesn't use Best Practices in the title. Even if it was special-cased, it's not like those questions will disappear, people will just ask around the keyword ban. Moderation won't change either, as reviewers and flaggers will still need to actually read the question first to decide whether it's on-topic or not. Commented Dec 9, 2015 at 22:34
  • 1
    @Brendan "Best Practices" questions are inherently off-topic as they are prone to attract purely opinion based answers and discussion, which is entirely against what Stack Overflow is about (Factual Answers to Questions). These questions are routinely closed using the reason "Primarily Opinion Based". I understand that you are a relatively new user here so you may not know this, but those questions are very off-topic Stack Overflow. Instead the user should ask an actual solvable question.
    – user4639281
    Commented Dec 9, 2015 at 22:38
  • @TinyGiant If they are inherently off-topic, how do you explain the questions linked in my answer, which we all agree are on-topic? Haha, I've been using SO for many years. Commented Dec 9, 2015 at 22:45
  • 2
    Those questions could exist very easily without the words "best practices" in them and be much less prone to opinion based answers and discussion. I'm sorry if my assumption based on your rep offended you, but because of your rep you cannot see the mass of crap deleted answers that these questions attract. From my previous argument: "*For questions that aren't actually about best practices but rather how to do something, they would no longer be closed incorrectly; for questions blatantly asking for opinion based answers, they would be stopped before they even made it onto the site."
    – user4639281
    Commented Dec 9, 2015 at 22:55
  • @TinyGiant That's entirely possible. It might just be that I don't see all the bad Best Practice questions because they are deleted before I ever see them. So the only ones I generally experience are good, on-topic Best Practice questions. Commented Dec 9, 2015 at 22:59
  • 2
    @Brendan The point is that any of those questions that are on-topic aren't actually Best Practice questions. They are, at there core, "How do I do X" questions, which are on-topic. Which means that any of those questions which are good and on-topic are actually being brought down by the "Best Practices" phrase in the question because of all the spam and garbage those questions attract, which has to then be deleted by users curating the content. If those words were not in the question to begin with, those users would not have to expend nearly as much effort curating that content.
    – user4639281
    Commented Dec 10, 2015 at 0:06

You must log in to answer this question.