This question already has an answer here:

I asked this question and it was put on hold as opinion based in less than an hour. A few months ago, I asked another question about good practices and it got squashed quickly as well. I didn't realize good practices were so opinion based. I thought it was an agreed upon set of standards (unique to each language) that seasoned programmers agreed on.

I'm trying to learn programming, and the Stack Exchange sites are a big source of help. Books don't offer a lot of help about specific best practices. So I figured this would be a good place to get the information from people that write code regularly and really know what is expected and allowed in production code.

Are questions about best practices on topic for Stack Exchange? And if not, why?

marked as duplicate by gnat, Martijn Pieters, Rory, ben is uǝq backwards, Lance Roberts Nov 30 '13 at 16:14

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • 2
    Without having checked the specific question in too much detail, one should be able to ask for the advantages and disadvantages of some specific approaches (assuming this isn't too broad), essentially allowing you to decide which makes for the best practice based on the contributing factors. – Dukeling Nov 24 '13 at 1:22
  • Some languages are more singular in their communities' opinions than others. PHP tends to have fewer agreed-upon standards, if only because the community is so large and often disconnected. – Amber Nov 24 '13 at 3:28

In an ideal world, your example question would be a fine addition to the site. Maybe it would need to be made a bit more abstract, but it's a-ok in general. But yes, "best practice" questions are all off topic. It doesn't mean that they all are bad questions - it just means that the community has chosen to ban them completely, as they tend to attract opinionated answers and extended discussion. Also, most questions asking for "best practices" aren't as detailed and specific as yours was - they tend to be more of the sort "I have no clue, plz give me a tutorial or code".


You mentioned best practice questions as being considered opinion-based. They can also be too broad. Consider that there are whole books that contain descriptions of best practices. The books Effective C++ and Effective Java, for example.

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