Skip to content

Technology Quote by Eric Freeman

“when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be careful, if you do this within a function you are creating a global variable. Note” quote by Eric Freeman
Download Open image
““when you assign a value to a variable name that hasn’t been previously declared, it is treated as a new, global variable. So be careful, if you do this within a function you are creating a global variable. Note””

Eric Freeman

About This Quote

Assigning to an undeclared identifier creates an implicit global, which can unintentionally expose state beyond its intended scope.

In simple terms: Implicit globals arise from undeclared assignments.

Key Takeaway

Avoid undeclared variables to prevent hidden globals.

Themes

scope variables bugs best practices language design

Mood

cautious analytical

Type

advice technical

When to use this quote

  • debugging a function
  • code review
  • teaching beginners
  • refactoring legacy code
  • static analysis

Key Concepts

global scope function scope implicit declaration state leakage

Practical Applications

  • static code analysis
  • coding guidelines

Questions to Reflect On

  • How could hidden globals affect program behavior?
  • What practices prevent accidental global creation?
4.1 out of 5 (9 ratings)

More by Eric Freeman

Explore all 90 Eric Freeman quotes

More Technology quotes

Browse all 12,247 Technology quotes