PR Descriptions vs. Code Comments: Raymond Chen on Documentation Best Practices
The Architectural Divide: PR Descriptions vs. Code Comments in the AI Era
Microsoft veteran Raymond Chen, writing on his The Old New Thing blog, identifies a fundamental architectural split in how developers document their work: PR descriptions function as transient persuasive artifacts, while code comments serve as persistent operational documentation.
The Tech TL;DR:
- PR Descriptions: Are strictly for the review process, aimed at justifying architectural changes to approvers.
- Code Comments: Are for the codebase lifecycle, providing durable context for future maintainers on function prerequisites and logic.
The Functional Mechanics of Documentation
The PR description is a point-in-time statement. Its primary objective is to convince a reviewer that a change is sound, performant, and secure. According to Chen, this is an exercise in persuasive technical writing.
Conversely, source comments must survive the lifecycle of the binary. They address the “how” and “what”—function prerequisites, edge cases, and non-obvious logic. When an engineer leaves a comment, they are writing for the person who will untangle that logic three years down the road.
Managing the Diff: Formatting and Consistency
The debate over code formatting—specifically the tabs-versus-spaces conflict—often distracts from the more critical issue of diff readability. While Microsoft veteran Larry Osterman has previously noted that spaces provide superior consistency in modern environments, Chen suggests the specific formatting style is secondary to how changes are submitted. A wholesale reformatting of a repository should never be bundled with functional changes.
When an entire file is reformatted, the PR diff becomes “epic” in size, obscuring the actual logic changes and making it impossible for reviewers to perform a meaningful security audit.
Implementation: A Standardized Approach to PR Hygiene
# Standardized commit message structure
git commit -m "feat: [Module Name] - Implement thread-safe cache eviction"
-m "PR Description: Addresses latency spikes in the NPU fetch cycle.
Replaces legacy list with a thread-safe concurrent map."
The Future of Self-Documenting Code
The persistent dream of “self-commenting code” remains a fallacy.

Disclaimer: The technical analyses and security protocols detailed in this article are for informational purposes only. Always consult with certified IT and cybersecurity professionals before altering enterprise networks or handling sensitive data.