0

...or, what is the best practice for capturing best practices?

Note that I am not asking what these best practices are; these will vary from person to person, team to team, language to language, domain to domain.

To clarify, I am curious if there is anything approaching a standard for capturing coding best practices such as...

Example best practices

  • Naming conventions
  • Comment tags used
  • The holy war of curly brace positioning
  • Logging policies
  • Restrictions or emphasis on various design patterns
  • When to break out a separate function, file, or library

...and so on. Obviously this list can go on forever!

What do I mean by capturing?

I mean encoding these best practices in a way that is the most useful.

Keeping this information as so-called tribal knowledge is a weak form of capturing, in that it is prone to inconsistency and data loss, and is not easily enforced.

Maintaining checkstyle configuration is a strong form of capturing, in that it is very explicit and easily enforced. However, it is not very flexible and fails to capture higher-level thinking.

Solutions I am aware of

  • Amalgamate over classics like Clean Code or Code Complete, which is not customizeable or domain-specific,
  • Leverage tooling like checkstyle, which can't capture the nebulous, or
  • Create custom documentation.

Is there something better? Thank you!

Dan
  • 802
  • 6
  • 22
  • I'm afraid I do not understand this question. Could you please clarify what you mean by "capturing"? It appears you understand it to be something more than "detect violations of" (in which case you'd probably be looking for linters). I also suppose you're not meaning it in the sense of "document". -- I imagine that there may indeed be standards of some sort when you focus on just one programming language / ecosystem at a time, but it seems unlikely to me that there's one overarching, global standard about The One True coding style that applies to all programming languages and ecosystems. – stakx - no longer contributing May 20 '18 at 17:54
  • @stakx Thank you for the illuminating comment. You helped me find a number of flaws in my question. I updated it to hopefully clarify! – Dan May 20 '18 at 18:07

0 Answers0