What's in a name?
summary
Code naming follows a concrete rule: choose length by the distance between declaration and use, so use short names for short scope (single-letter i/j for loops, n for counts, db for database, ctx for context) and longer, descriptive names for package-level or widely used identifiers. Stop repeating types in names — don't repeat type in name — and prefer functions named for their result while methods name the action. Favor small functions, consider the functional options pattern for many constructors, and avoid catchall util packages or embedding v2 in package names.
AI-written summary · about
chapters (18)
- 0:00Introduction
- 1:09Why names matter in Go
- 2:55Variable naming principles
- 7:57Scope and variable proximity
- 9:03Avoid type names in variables
- 11:34Predictable naming conventions
- 13:46Common short variable names
- 14:08Function naming best practices
- 17:56Functional options pattern
- 19:02Method naming conventions
- 20:10Package naming philosophy
- 22:00Avoiding utility packages
- 24:10Combining similar concepts
- 25:35Package naming pitfalls
- 26:40Avoid stealing good names
- 27:22Key characteristics of good names
- 29:51Package globals and scope
- 30:32Q&A session begins








