Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

I've often searched for answers relating to "best practice" when writing code. And I see many questions regarding what is best practice.

However, I was thinking the other day. Who actually determines what this best practice is? Is it the owners or creators of the programming language. Is it the general developer community that is writing in the language and it's just a gut feeling consensus. Is it whoever seems to have the highest prestige in the developer world and shouts the loudest? Is best practice really just another term for personal opinion?

I hope this is a constructive question. If I could word it better to ensure it doesn't get closed please feel free to edit, or inform me otherwise.

share|improve this question
6  
General consensus. There isn't some overarching authority that decrees which practices are "best". Some practices just prove their worth over others. The definitive best practice is to use your head; understand "best" practices and their tradeoffs, and don't just blindly accept someone's idea of a best practice just because they say so. –  Robert Harvey Oct 29 '12 at 21:55
1  
We do. Most highly voted answers on Programmers questions qualify as the "best practice" for the problem they are solving. –  Yannis Rizos Oct 29 '12 at 21:57
    
@YannisRizos: If only that were always the case. –  pdr Oct 29 '12 at 21:58
1  
@Pdr Obviously it's not always the case, but it's one of the goals of the site, provide canonical answers to software development questions. –  Yannis Rizos Oct 29 '12 at 22:00
    
So it's personal opinion then, backed up by a lot of other people having the same opinion making it the majority opinion. wow, that sentence confused me :) –  dreza Oct 29 '12 at 22:06
show 1 more comment

closed as not constructive by pdr, Robert Harvey, Walter, dreza, Yusubov Oct 29 '12 at 22:59

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

2 Answers

up vote 6 down vote accepted

There's no clear rule, but "general consensus" comes close. Language creators and other high prestige people may have a greater weight given to their opinion, but it's really only "best practice" if it's widely accepted. Of course, there's no way to prevent opinionated individuals from claiming their half-assed ideas to be "best practice" as well, so don't believe it until you've heard it from multiple credible sources.

Additionally, I'd say that a "best practice" should generally

  • be applicable in a wide variety of situations
  • be time-tested
  • come with explanations why it's best (allowing you to draw conclusions about when it's appropriate and when not)
share|improve this answer
    
Cheers Micheal. General consensus seems to be the train of thought. I guess general consensus comes from sites such as this, and other Q&A sites etc –  dreza Oct 29 '12 at 22:11
    
Time tested. It needs to have been out in the wild and bashed by real world use cases for a while so that you can actually validate that it works. –  Loki Astari Oct 30 '12 at 0:00
add comment

It is general consensus. Programmers (and authors) with a lot of respect tend to have their opinions get more weight. As people use things, they tend to find what works and refine best practices based on observational data and peer review. The industry is immature yet, but this sort of thing occurs in other disciplines as well (although in better/more fomalized forms in those that are more mature).

share|improve this answer
    
Thanks Telastyn. Seems to be what the other commenters said. Appears the question is going to be closed anyway but thanks for answering –  dreza Oct 29 '12 at 22:10
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.