In Da Programming: BINDING

The word binding is used in any sphere of life and as it is understood from the title, yes we do have binding in programming too, and it is highly important to know.

Simply to emphasize,a binding is an association between an attribute and an entity

Example:

  1. binding between a variable and its type or value
  2. binding between an operation and a symbol

Everything in life takes time as is binding but not every spent time has a special naming unless we are not talking about binding.

The time at which a binding takes place is called binding time.

Now we reach to the point where the fun begins. Since the concept is time, it should have start and end(unless not starts from eternity and goes to infinity), therefore, I will shortly drop down a list of time ranges where binding process can happen. Before I do, I really find it crucial to emphasize that binding and binding times are prominent concepts in the semantics of programming languages and it must be understood well.

Here we go, bindings can take place at

  1. Language design time — for example, the asterisk symbol(*) is usually bound to the multiplication operation at the design time.
  2. Language implementation time — for example, a data type, let’s say int in C, is bound to a range of possible values at language implementation time.
  3. Compile time — for example, a variable in Java program is bound to a particular data time in compile time.
  4. Load time — for example, a variable may be bound to a storage cell when the program is loaded into memory, which is load time.
  5. Link time — for example, a call to a library subprogram is bound to the subprogram code at link time.
  6. Run time — for example, variables declared in Java methods are bound in run time.

Example: in this example C++ assignment statement has taken into hand and we will investigate different bounding spheres

count = count + 5;

  • Compile Time: the type of the count is bound
  • Compiler Design Time: the set of possible values of count is bound
  • Compile Time: the meaning of the operator symbol + is bound, when the types of its operands have been determined.
  • Compiler Design Time: the internal representation of the literal 5 is bound
  • Run Time: the value of count is bound.

REFERENCES

  1. Sebesta, R. W. (n.d.). Names, Bindings and Scopes. In Concepts of Programming Languages (12th ed., pp. 203–205).

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store