Interview Questions

Naming Convention - Module-level variables ("member-vars")

Coding standards for Rational Robot


(Continued from previous question...)

Naming Convention - Module-level variables ("member-vars")

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

(Continued on next question...)

Other Interview Questions