Monday, December 11, 2017

VBScript - Coding Standards

Constant Names

Constant Names 

Names of constants should be meaningful noun or noun phrases with all letters capitalized. Multiple words were separated using the underscore (_) character. 


Example: MY_VARIABLE

Function Names
Function Names (or) Module names should be meaningful words or phrases that describe the abstraction of the module.  Use nouns for object abstractions and verbs for functional abstractions.  Module names should be without spaces, in mixed case, with the first letter uppercase, and the first letter of each subsequent word capitalized.  

Boolean Function Names

Functions that return the results of a test of a Boolean condition T should be named IsT, HasT, or CanT.


Variable Names

  • Append computation qualifiers (Avg, Sum, Min, Max, Index) to the end of a variable name where appropriate.
  • Boolean variable names should contain Is which implies Yes/No or True/False values, such as fileIsFound.
  • Do not use literal numbers or literal strings, such as For i = 1 To 7. Instead, use named constants, such as For i = 1 To NUM_DAYS_IN_WEEK for ease of maintenance and understanding.

1 comment:

  1. Hi Sir, I am very much impressed about your tutorial videos and step by step approach and presentations, like to get in touch with you for guidance on my projects. Hope you will help me in this regard

    ReplyDelete