Skip to content

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.” quote by Alan A. A. Donovan
Download Open image
““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.””

Alan A. A. Donovan

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.

Key Takeaway

Use short declarations for local variables only.

Themes

programming scope syntax

Mood

technical informative

Type

educational technical

When to use this quote

  • function bodies
  • local state
  • code readability

Key Concepts

Go language variable declaration

Questions to Reflect On

  • When should you prefer a full variable declaration?
  • How does scope affect code organization?
A Different Perspective

Cannot declare package-level variables with this form, limiting global state management.

3.2 out of 5 (5 ratings)

More by Alan A. A. Donovan

Explore all 3 Alan A. A. Donovan quotes

More Short quotes

Browse all 2,581 Short quotes