Introduction and Philosophy
Introduction
About This Book
Slow Down
Use AI Coding Assistants Judiciously
Treat AI Like An External Contributor
Balance Determinism (Tools) and Non-Determinism (AI and Humans)
Definitions and Types of Programming Languages
Programming Is Not Magic
Remember: Your Language Is Not Single Paradigm!
Know Your Standard Library and The Industry Standards
Use The Tools
Don’t Invoke Undefined Behavior
- Build an Automated Foundation
Use Continuous Integration
Automate Your Tests
Track Branch and Path Test Coverage
Use Your Package Manager Wisely
Maximize Compiler and Interpreter Warnings
Test With Multiple Compilers and Interpreters
Analyze and Lint Your Source Files
Create Custom Static Analysis
Apply Runtime Analysis
Harden Your Binaries Against Attacks
Detect Copy-Pasted Code
Set Code Complexity and Length Limits
Fuzz Test Your API
Mutation Test Your Tests
Analyze Your CI Runs
- Follow a Strict Process
Use Source Control
Stay Strict Even on Small Projects
Lock Important Branches
Keep Tasks Small
Require All Checks Pass
Require Code Reviews
Prefer Squash Merges
- Establish Good Coding Patterns
Be Afraid of Global State
Make Your Interfaces Hard to Use Wrong
Use Stronger Types
Consider If Using the API Wrong Invokes Undefined Behavior and Use Contracts
Don’t Let Return Values Be Ignored
Don’t Return Unmanaged Resources
Avoid Manual Resource Management
Decouple Your APIs and Make Them Generic When You Can
Avoid Complicating Simple Things
Prefer Higher Level Constructs
Don’t Copy and Paste Code
Prefer Immutability
Always Initialize Your Values
Limit Variable Scope
Treat Control Statements as Expressions
- Final Thoughts and Appendices
TL;DR
Continue Your Developer Education
Developer Tooling Reference
Exercise Index
Exercise Index, Alphabetically
This Chapter Was Not Written By A Human
Thank You