Plugin Variable Notation
Posted: 25 Aug 2011 18:27
The Help for The Family Historian API defines a 'Hungarian' notation for parameters.
i.e.
ptr = pointer object
dt = date object
dp = date-point object
str = text string
i = integer
b = boolean (true or false)
tbl = Lua table of values
However, the Sample Plugin Scripts do not always adhere to this notation.
e.g.
Some pointer objects are simply pi or pf.
Some text strings start with s instead of str.
Some variables do not use the notation at all.
The IUPLUA GUI builder examples tend to use similar notations for its data types.
1) Should the FH API Sample Plugin Scripts be improved to use its notation more faithfully?
2) Should LUA scripts use a similar notation as good style, even where not using the FH API?
3) Should Knowledge Base LUA code snippets follow a similar style guide?
If so perhaps a few more 'Hungarian' prefixes are needed.
e.g.
num or fp = floating point number
etc...
ID:5409
i.e.
ptr = pointer object
dt = date object
dp = date-point object
str = text string
i = integer
b = boolean (true or false)
tbl = Lua table of values
However, the Sample Plugin Scripts do not always adhere to this notation.
e.g.
Some pointer objects are simply pi or pf.
Some text strings start with s instead of str.
Some variables do not use the notation at all.
The IUPLUA GUI builder examples tend to use similar notations for its data types.
1) Should the FH API Sample Plugin Scripts be improved to use its notation more faithfully?
2) Should LUA scripts use a similar notation as good style, even where not using the FH API?
3) Should Knowledge Base LUA code snippets follow a similar style guide?
If so perhaps a few more 'Hungarian' prefixes are needed.
e.g.
num or fp = floating point number
etc...
ID:5409