Short Quote by Alan A. A. Donovan
““The first form, a short variable declaration, is the most compact, but it may be used only within a function, not for package-level variables.””
About This Quote
Source Book: Go Programming Language by Alan A. A. Donovan and Brian W. Kernighan, 2015
Short variable declarations are concise but limited to function scope, preventing their use for package-level state.
In simple terms: Compact declarations work only inside functions.
Use short declarations for local variables only.
Themes
Mood
Type
When to use this quote
- function bodies
- local state
- code readability
Key Concepts
Questions to Reflect On
- When should you prefer a full variable declaration?
- How does scope affect code organization?
Cannot declare package-level variables with this form, limiting global state management.