[Latest News][6]

CBSE
Essay Writing
G.K & Current Affairs
Information & Technology
Letter Writing
News Letter
Passage Writing
Report Writing
SEBA

What Are Coding Conventions?




VBScript Coding Conventions?

Coding conventions are suggestions that may help you write code using Microsoft Visual Basic Scripting Edition. Coding conventions can include the following:

  1. Naming conventions for objects, variables, and procedures
  2. Commenting conventions
  3. Text formatting and indenting guidelines



The main reason for using a consistent set of coding conventions is to standardize the structure and coding style of a script or set of scripts so that you and others can easily read and understand the code. Using good coding conventions results in precise, readable, and unambiguous source code that is consistent with other language conventions and as intuitive as possible.


Constant Naming Conventions

Earlier versions of VBScript had no mechanism for creating user-defined constants. Constants, if used, were implemented as variables and distinguished from other variables using all uppercase characters. Multiple words were separated using the underscore (_) character. For example:



  1. USER LIST MAX
  2. NEW LINE



While this is still an acceptable way to identify your constants, you may want to use an alternative naming scheme, now that you can create true constants using the Const statement. This convention uses a mixed-case format in which constant names have a "con" prefix. For example:

ConYourOwnConstant


Variable Naming Conventions

For purposes of readability and consistency, use the following prefixes with descriptive names for variables in your VBScript code.

Subtype Prefix Example
Boolean bln blnFound
Byte byt bytRasterData
Date(Time) dtm dtmStart
Double dbl dblTolerance
Error err errOrderNum
Integer int intQuantity
Long lng lngDistance
Object obj objCurrent
Single sng sngAverage
String str strFirstName




About Author Mohamed Abu 'l-Gharaniq

when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries.

No comments:

Post a Comment

Start typing and press Enter to search