3rd Chapter – Names, Bindings, and Scopes

Basically this chapter is more about what is listed on the title.

 

Names

As the word describes, this is about the rules of naming a variables.

Length => there are minimum but there is the limit on how many characters you can put but it depends on the language which are being used. Example: FORTRAN 95 max is 31 while C99 have no limit but only the first 63 are significant.

Special character => some languages need the use of special character for naming a variable. Example: PHP variables must begin with dollar sign.

Case sensitivity => names inĀ  C-based languages are case sensitive which means different case different variable whilst others language are not sensitive.

Special words => Some words are already defined, so you cannot use it as the name of variables.

 

Variables

A variable is an abstraction of a memory cell

Variables can be characterized as a sextuple of attributes which are name, address, value, type, lifetime, and scope. Meaning: you can insert or define those attributes in the variables.

 

Binding

An association between an entity and an attribute, such as between a variable and its type or value, or between an operation and a symbol.

Binding time is the time at which a binding takes place.

Dynamic type binding is used for its flexibility on the cost of high cost and harder error detection.

 

Scope

the range of statements over which it is visible it can used to making local/non-local/global variables.

Static scope is based on program text and need declaration in order to connect variables.

Dynamic scope is based on calling sequences of program units, not their textual layout (temporal versus spatial) and connected by searching back.

Global scope is on the program itself.

This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *