Formatting Code Samples in Technical Documentation
Formatting Code Samples in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it scoped to technical instructions rather than presenting it as a universal grammar rule.
ReviewedEvidence1 sourceSectionWriting & Style
Quick answer
Use code style for code samples and code elements presented in text, following the Microsoft developer-content convention for programmatic material.
Key details
Core Issueformatting code samples in developer content
RegisterMicrosoft technical and professional documentation
Important caveats
Scope Boundary
This is Microsoft developer-content style; language-specific syntax and an organization’s own code-formatting standards may impose additional requirements.
Further guidance
Content
Use code style for code samples and code elements presented in text, following the Microsoft developer-content convention for programmatic material.
Purpose
Visually distinguish literal code from explanatory prose so readers can identify what belongs to the program or syntax.
Sources and evidence
Sources are shown with the role they play in this guide. Historical or style-sensitive claims are kept within the evidence boundary described above.
Formatting Code Keywords in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting AI Prompts in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Attributes in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Classes in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Constants in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Control Classes in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Data Formats in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.
Formatting Data Types in Technical Documentation records a distinct Microsoft Style Guide authoring convention and keeps it explicitly scoped to technical documentation rather than presenting it as a universal grammar rule.