Review:
Lexical Scope
overall review score: 4.5
⭐⭐⭐⭐⭐
score is between 0 and 5
Lexical scope is a programming concept that determines the visibility of variables within a program.
Key Features
- Variables defined in a block are visible within that block and any nested blocks
- Variables declared outside of a block are visible throughout the program
- Scope resolution is determined at compile time
Pros
- Promotes code organization and modularity
- Prevents variable conflicts and unintended side effects
Cons
- Can lead to issues with global variables and scoping confusion for beginners