staticscoping

noun
UK /ˈstætɪkˌskəʊpɪŋ/
US /ˈstætɪkˌskoʊpɪŋ/

A way a computer decides which name belongs to which thing by looking at where the name is written in the code.

The teacher explained that static scoping means a variable's meaning is fixed by where it appears in the program.


OTHER MEANINGS

2. The rule that a function can see variables from the place where it was written, not where it is called.

Because of static scoping, the inner function could use the outer variable even when called elsewhere.

3. A property of programming languages where name lookup is decided before the program runs.

Static scoping makes code easier to read because you can find a variable's meaning by looking at the surrounding text.

4. The opposite of dynamic scoping, where meaning depends on the order of calls at runtime.

The language uses static scoping, so the result does not change depending on who calls the function.