Simyl
simylflow
Course Home
Module 4: Team Practices
Lesson 3 of 5
10 min

Coding Standards

Agreed-upon conventions that reduce friction and enable collective ownership.

1Why Standards Matter

Coding standards are team agreements about how code should be written:

  • Naming conventions (camelCase vs snake_case)
  • Formatting (tabs vs spaces, brace placement)
  • Code organization (file structure, module boundaries)
  • Patterns (how to handle errors, how to structure tests)

Standards enable collective ownership. When code looks the same everywhere, anyone can read any code. There's no "translation" between Bob's style and Alice's style.

Standards also reduce friction in code review. Instead of debating formatting, you discuss logic and design. The bikeshedding goes away.

Without standards: Every file feels different. Moving between modules requires mental context-switching. Code review becomes style warfare.

With standards: The codebase feels unified. Reading unfamiliar code is easier. Reviews focus on what matters.

The specific standard matters less than having a standard. Pick something reasonable and stick to it.

2Standards vs Style

Not all conventions are equal. Distinguish between:

Semantic standards: Affect code behavior or maintainability

  • Error handling patterns
  • Logging conventions
  • Test structure
  • API design patterns

Stylistic standards: Affect appearance only

  • Formatting (indentation, line length)
  • Naming (camelCase vs snake_case)
  • Brace placement

Semantic standards deserve discussion. How the team handles errors is a meaningful decision with real consequences.

Stylistic standards should be automated. Use Prettier, Black, gofmt—tools that format code automatically. Don't waste human time on tabs vs spaces.

The goal is to remove friction, not to achieve some platonic ideal of code style.

3Automated Enforcement

Modern tooling can enforce most standards automatically:

Formatters: Prettier (JavaScript), Black (Python), gofmt (Go), rustfmt (Rust)

  • Run on save or as a pre-commit hook
  • Eliminate formatting discussions entirely

Linters: ESLint, Pylint, Clippy, RuboCop

  • Catch style violations and potential bugs
  • Configurable to team preferences
  • Run in CI to prevent non-compliant code from merging

Type checkers: TypeScript, mypy, Flow

  • Enforce type consistency
  • Catch errors before runtime

Pre-commit hooks: Husky, pre-commit

  • Run checks before code is committed
  • Catch issues before they enter the repository

Configure once, enforce forever. Don't rely on human discipline—automate it.

Good Standards Enforcement

The team uses Prettier with a shared config. Every commit triggers formatting. Code review never mentions formatting—it just focuses on logic and design.

Manual Standard Enforcement

The team has a 50-page style guide. Reviewers spend half their time pointing out style violations. Developers resent the nitpicking. New team members struggle to learn all the rules.

4Establishing Standards Without Religious Wars

Standards can trigger strong opinions. Avoid endless debate:

Start with existing conventions. If the language or framework has standard style (Go, Rust), just use it. Don't reinvent.

Use industry defaults. Popular linter/formatter configs (Airbnb ESLint, Google style guide) are battle-tested.

Decide quickly, adjust later. Pick something reasonable. If it proves problematic, change it. Don't block progress waiting for the perfect standard.

Make it democratic but decisive. Let the team vote on contentious issues. Majority wins. The minority accepts the decision.

Remember the goal. Standards exist to reduce friction, not to express preferences. If a discussion is taking too long, any reasonable choice is fine.

Don't Optimize Prematurely

Spending a week debating semicolons is not a good use of time. Pick a formatter and move on.

5Living Documentation

Standards should be documented—but keep them living:

What to document:

  • Semantic standards (how to handle errors, test patterns)
  • Rationale for non-obvious choices (why we chose X over Y)
  • Exceptions and when to break rules
  • How to propose changes

Where to document:

  • README or CONTRIBUTING file in the repo
  • Wiki or team documentation space
  • Comments in the linter/formatter config

Keep it current. Outdated documentation is worse than no documentation. When you change a standard, update the docs.

Make it findable. New team members should find the standards easily. Don't bury them in a wiki maze.

The best documentation is the code itself. If your standards are enforced automatically, the code demonstrates what's acceptable.

Key Takeaways
  • Standards enable collective ownership by making all code readable
  • Automate stylistic enforcement—don't waste human time on formatting
  • Semantic standards (patterns, error handling) deserve discussion
  • Pick reasonable defaults quickly; don't let debates block progress
  • Document standards and keep documentation current
Common Pitfalls to Avoid
  • Endless debates about formatting (automate it instead)
  • Manual enforcement that wastes review time
  • Ignoring standards in 'quick fixes' that become permanent
  • Outdated documentation that doesn't match reality

Practice Exercises