-
Book Overview & Buying
-
Table Of Contents
Learn Bosque Programming
By :
While we write code, it is anticipated that, with the increase in the number of lines of code written, we may lose track of all the names and identifiers already used in the code and this might lead to mistakes such as overwriting values or referencing incorrect identifiers. To solve this problem, programming languages have been implementing namespaces for a number of years.
When we talk about namespaces, we are referring to abstract containers that allow us to group identifiers and variables, creating a useful association in terms of avoiding possible duplicate name errors. This allows us to be able to better expose the intent of specific pieces of code.
Additionally, namespaces are useful when building libraries since, as a result of having code that is not visible to the programmer, it might not be easy to avoid duplicating identifiers.
To declare a namespace in Bosque, we will use the namespace keyword accompanied by an identifier at the...