English Reference

Word

global variable

Definition

compound. a piece of information in a computer program that any part of the code can see and change. You use it when you want data to be available everywhere in your project.

compound. a variable declared outside of any specific function or block, making it accessible throughout the entire program's scope. Often discouraged in modern software engineering due to the risk of unintended side effects across different modules.

Examples

“The programmer used a global variable to store the user's name.”

“While using a global variable is convenient for small scripts, it can make debugging large applications very difficult.”

“The architectural review highlighted that over-reliance on a global variable for state management had introduced several race conditions that were nearly impossible to replicate in a testing environment.”

Examples

simple

“The programmer used a global variable to store the user's name.”

contextual

“While using a global variable is convenient for small scripts, it can make debugging large applications very difficult.”

complex

“The architectural review highlighted that over-reliance on a global variable for state management had introduced several race conditions that were nearly impossible to replicate in a testing environment.”

Usage

Commonly used in the plural; often contrasted with 'local variable'.

Etymology

A compound of the adjective global, derived from the Latin globus, and the noun variable, from the Latin variabilis. The term emerged as a logical extension of scope terminology in early procedural programming languages to distinguish these entities from local counterparts.

Etymology adapted from Wiktionary, available under CC BY-SA 4.0.

Domain

Programming

This entry

Exam level
CambridgeCambridgeCambridge English QualificationsThe exam suite from Cambridge University Press & Assessment, from A1 Movers up to C2 Proficiency. The benchmark names double as CEFR labels.C1 AdvancedIELTSIELTSInternational English Language Testing SystemThe 0–9 band test co-owned by the British Council, IDP, and Cambridge. Used for university entry, work, and migration.7.0–8.0TOEFL iBTTOEFL iBTTest of English as a Foreign Language, Internet-Based TestETS's academic English test, the standard route for US university admissions. Scored 0–120, with a 1–6 scale since 2026.1–6 scale: 5.0–5.595–113TOEICTOEICTest of English for International CommunicationETS's workplace English test, big in Japan and Korea. Listening & Reading scores 10–990 and tops out at C1.945–990
Level
C1 · Advanced
Updated

QR code

englishreference.com/q/global-variable

English Reference