5

What is a term for the category of global and local in programming? For example I want to use local/global in my game, but I need a word that means global or local. The word be used like so:

The ____ is global.

For programmers

I'm trying to make an enumeration that uses Global and Local, except I need a word to categorize the enum.

Edit: To clarify why the answer is definitely scope: I am making a high score system and I would like there to be the local high score and the global high score.

  • 8
    Do you mean "scope"? – michael.hor257k Sep 5 '16 at 23:25
  • I think thats it! – Jack Sep 5 '16 at 23:32
  • Turn that into an answer and I'll give it to you – Jack Sep 5 '16 at 23:33
  • I would say "declaration", as you declare to the code that variable is either a local variable or a global variable. – 3kstc Sep 6 '16 at 2:12
  • Its scope because I'm specifically trying to figure out whether it is local or global. – Jack Sep 6 '16 at 2:47
23

In programming, scope is the term used to describe the parts of the program where a binding of a name to an entity - e.g. a variable - is valid.

  • Cant believe I forgot that -_- – Jack Sep 5 '16 at 23:40
  • 1
    Scope is the word in almost every context, not just programming – curiousdannii Sep 6 '16 at 6:46
2

range defines the area or sphere in which an activity takes place.

  • the limits within which any fluctuation takes place.
  • the limits within which a thing can function effectively - TFD
  • 1
    Note that this is a question specifically about programming lexicon, and range means something completely different to scope. – GreenAsJade Sep 6 '16 at 4:01
2

You have an answer, but as another option:

Domain

  • the local domain
  • the global domain

Or

  • the domain is local
  • the domain is global
  • This may be true too. I'll think about this one. – Jack Sep 6 '16 at 12:10
  • In my vocabulary, scope is the property, and it can take on values from the domain of {global,local}. – michael.hor257k Sep 6 '16 at 13:27
1

I would say this depends heavily on the blank in your question.

In the problem domain you are modelling in your program, what exactly is it that has the property global or local? If it's variables, then it's scope. But if it's influence of characters (maybe you're building an RPG) reach or range etc. might be better words...

It's analogous to asking what's a good enum name for the values 1meters and 2meters — it depends on whether you're modelling the height of characters or radius of pillars.

0

"Binding" is another word often used in computer science, which means the same as " scope ".

Example: Variable " X " is locally bound.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.