Interview Questions

Naming Convention - Functions

Coding standards for Rational Robot

(Continued from previous question...)

Naming Convention - Functions

Functions abstract a sequence of SQABasic code statemens in either a script-file (.REC) or a library-file (.SBL) and cover them with a reasonable name that is explanatory to others.

[SOURCE]+"_"+[PerformedAction]+[Parameterlist]+" As " + [ReturnValue]

[SOURCE] is an abbr. of the library name it is implemented at. [PerformedAction] consists of two words, an action(verb) and an object the action is performed against. [Parameterlist] is a sequence of placeholders the function is feeded with. [ReturnValue] is the value returned by the function

UTIL_CountItemInString(sHaystrack$, sNeedle$) As Integer
SERVICE_Start(sServiceName$) As Integer
SERVICE_StopAllServices() As Integer

The function name must always correspond to what the function is actually doing. That is the script developer knows what the function is doing without the need to dig any deeper into its implementation. If the function name is called "NaviagteTo("a-web-link") it is expected that the function does only navigate to that specific web-link and not doing additional actions that is deletion and/or creation of any records in the DBMS.

(Continued on next question...)

Other Interview Questions