Establishing Standard Prefixes in Your ColdFusion Code


Submitted by Tyson Vanek, tyson.vanek@remotesite.com

Establishing standard naming conventions for variables in your ColdFusion code can help you and other developers identify what is being stored in different variables. Specifically, it will help indicate which data type is stored in the variable (such as string, integer, Boolean, array, structure, or query result set). Table 28.1 includes a list of suggested prefixes. You could always come up with your own replacements or additions to this list.

Table 28.1. Suggested Prefixes for Various Data Types

Prefix

Data Type

Example

str

String

strVariableName

int

Integer

intVariableName

num

Numeric

numVariableName

bln

Boolean

blnVariableName

lst

List

lstVariableName

arr

Array

arrVariableName

stc

Structure

stcVariableName

qry

Query

qryVariableName

uuid

UUID

uuidVariableName

w

WDDX packet

wstcVariableName or wqryVariableName



Inside ColdFusion MX
Inside Coldfusion MX
ISBN: 0735713049
EAN: 2147483647
Year: 2005
Pages: 579

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net