Coding Standards/conventions Question:
Download Job Interview Questions and Answers PDF
Explain Naming Convention Globals?
Answer:
Description
The values of global variables can be used and changed all over the project within all scripts and libraries. Though it is highly recommended to keep the number of global variables small. If global variables tend to be used in a specific project only it is advisable to keep those values in either a project specific library header or in a separate configuration file.
Syntax
"g" + [Prefix]+[ShortDescription]
Letter “g” indicates that the scope of the variable is global. [Prefix] is a lowercase letter that represents the type of the global variable. The rules for [Prefix] are the same as for “Local scope variables”.
Examples
· gnNumOfPersons
· gsPersonLastname
The values of global variables can be used and changed all over the project within all scripts and libraries. Though it is highly recommended to keep the number of global variables small. If global variables tend to be used in a specific project only it is advisable to keep those values in either a project specific library header or in a separate configuration file.
Syntax
"g" + [Prefix]+[ShortDescription]
Letter “g” indicates that the scope of the variable is global. [Prefix] is a lowercase letter that represents the type of the global variable. The rules for [Prefix] are the same as for “Local scope variables”.
Examples
· gnNumOfPersons
· gsPersonLastname
Download Coding Standards Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain Naming Convention in Arrays? | Explain Naming Convention Constants? |