A Suggested Variable Naming Convention for IDL Programming
Loosely modeled after the Leszynski/Reddick naming convention commonly used in VBA and other programming languages, it uses a <prefix><Name> pattern.
Here are some examples:
- intNum - integer number, i.e. intNum = 2
- lngNum - long integer number, i.e. lngNum = 2L
- fltNum - float number, i.e. fltNum = 2.0
- dblNum - double number, i.e. dblNum = 2.0d
-
- arrNum - an array of numbers, i.e. arrNum = [ 1, 2, 3 ]
- farrNum - an array of float numbers, i.e farrNum = [ 1.0, 2.0, 3.0 ]
- darrNum - an array of double numbers, i.e darrNum = [ 1.0d, 2.0d, 3.0d ]
-
- strLetter - a string variable, i.e strLetter = 'some words'
- strarrLetter - an array of strings, i.e strarrLetter = [ 'one', 'two', 'three' ]
-
- structData - a data structure, i.e. ctm_get_data, structData, Diagn, Tracer, Tau0
By using a self-descriptive variable name convention, potential errors can be prevented, such as trying to multipy a string and a number array, for example:
- farrSomeArray = strLetter * farrNum