liveBook · Manning

Style guide

As explained in Lead Developer Career Guide

A rule set governing how source code is written, structured, and maintained within a software project or organization.

A source-code style guide is a shared set of rules for writing and organizing code. Its aim is consistency: a developer should be able to find and understand code without first learning each teammate’s personal habits. That makes bugs easier to fix and features easier to improve. section 1.2.4 section 5.1.1

Make the rules specific enough to use during everyday work. A guide can cover:

  • Naming patterns for files, directories, modules, functions, and features. section 1.2.4
  • Formatting details, such as where an opening curly brace goes after an if statement. section 1.2.4
  • Commenting expectations and other practices that reviewers can check consistently. section 1.2.4 section 5.1.3

A new developer joins a project

Rather than guessing how to name a function or format a change, the developer reads the team’s standards during onboarding. A reviewer then uses the same rules when checking the change. If several reviews uncover the same mistake, the lead developer can discuss it with the whole team instead of correcting people one at a time. section 1.2.4 section 5.1.3

Put the guide somewhere every team member can reach it, and keep it current. An existing organization-wide standard is a starting point, not something to silently replace. Invite team feedback and revisit rules as technologies and practices change. The guide also belongs alongside workflow and deployment documentation: together, these references reduce avoidable confusion and rework. section 1.2.4 section 5.1.1 section 5.1.2

Do not confuse a source-code style guide with a technical-writing style guide. The latter governs documentation—such as grammar, word choice, headings, and layout—rather than how code is named and formatted. Both help a team produce work that others can read and maintain. section 5.3.4 section 1.2.4

How Lead Developer Career Guide covers it

How deep it goes
Details naming, braces, comments, documentation, onboarding, review, and revision; stops short of prescribing a complete project-specific guide.
Examples
Uses curly-brace placement, function comments, and names for files, directories, modules, functions, and features.
What it assumes
Assumes familiarity with a development team and basic source-code structures; illustrates conventions with names, comments, and braces.
What you can do after
Operate/configure it by documenting team rules, reviewing them during onboarding, enforcing them in code review, and updating them with feedback.
How it connects
Links coding conventions to code review, developer onboarding, technical documentation, and technical debt.

Also explained in

Compare how 10 books explain style guide →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Lead Developer Career Guide. The section links point to the parts of the book it draws on.