Literature incorrectly using word "scope"

G

G Fernandes

Scope is a property of identifiers and defines where they are visible
in a source file. Why then do most writings on C also use the word
"scope" to refer to a property of different points of a source file.
For example, "the function call has a prototype in scope.." should
really be "the function call is in the scope of a prototype." Points
in source files don't have scopes, they are withing scopes of
declarations.

How come almost all literature prefers to use "has no declaration in
scope" instead of "not in the scope of a declaration."

Am I the confused one? Are there really two meanings for the word?
Anyone have any insights into this poor use of the word?
 
R

Richard Tobin

Scope is a property of identifiers and defines where they are visible
in a source file.

Like many words used in technical contexts, "scope" has been taken
from non-technical English and given more precise meanings. These
meanings aren't always perfectly consistent.

"Scope" is used in various analogies of seeing. In English, the scope
of something is "what it can see" - for example the scope of an
inquiry is the range of things it can investigate. In computer
science, the scope of a variable is where it can be seen. Something
is in scope if it can be seen. Perhaps the principle of reversability
of light is relevant here.

-- Richard
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top