Coding Standards/conventions Question:
Download Job Interview Questions and Answers PDF
Explain Naming Convention in Module-level variables (member-vars)?
Answer:
Description
If variables are placed outside a function body their scope will be different from a local scope variable, therefore we flag those variables with a prefix "m_" that is very common in object oriented languages even though SQABasic is not an object oriented programming language.
Syntax
"m_" + [Prefix]+[ShortDescription]
[Prefix] is a lowercase letter (either "n", s", "str", "d" or "t" appropriate to the type it represents) [ShortDescription] is a corresponding name of what the variable stands for. If [ShortDescription] consists of more then one word these are all separated using a capital letter for each new word.
Examples
· m_nCountDatabaseRecords
· m_strLastname
· m_sPassword
If variables are placed outside a function body their scope will be different from a local scope variable, therefore we flag those variables with a prefix "m_" that is very common in object oriented languages even though SQABasic is not an object oriented programming language.
Syntax
"m_" + [Prefix]+[ShortDescription]
[Prefix] is a lowercase letter (either "n", s", "str", "d" or "t" appropriate to the type it represents) [ShortDescription] is a corresponding name of what the variable stands for. If [ShortDescription] consists of more then one word these are all separated using a capital letter for each new word.
Examples
· m_nCountDatabaseRecords
· m_strLastname
· m_sPassword
Download Coding Standards Interview Questions And Answers
PDF
Previous Question | Next Question |
Explain Naming Convention in Local scope variables? | Explain Naming Convention in Arrays? |