This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
howtos:toolcoding:good_practices [2010/11/05 17:11] deryn.crockett |
howtos:toolcoding:good_practices [2010/11/08 16:30] marcus.williams |
||
---|---|---|---|
Line 39: | Line 39: | ||
Method 2 is the recommended method for consolidating objects. The main advantage is that with method 2 if airFuelUse[], railFuelUse[], or carFuelUse[] were empty objects, this would be detected when trying to view fuelUseAll[tm]. With method 1, an empty object would not necessarily be detected when viewing fuelUseAll[tm]. If railFuelUse[] were empty, the values for rail in fuelUseAll would just become 0 after carFuelUse[] is inserted so the empty object would go undetected. | Method 2 is the recommended method for consolidating objects. The main advantage is that with method 2 if airFuelUse[], railFuelUse[], or carFuelUse[] were empty objects, this would be detected when trying to view fuelUseAll[tm]. With method 1, an empty object would not necessarily be detected when viewing fuelUseAll[tm]. If railFuelUse[] were empty, the values for rail in fuelUseAll would just become 0 after carFuelUse[] is inserted so the empty object would go undetected. | ||
- | ===== Variable Naming ===== | + | ===== Variable description and name conventions ===== |
Stub: best practices for variable naming, esp. locals FIXME | Stub: best practices for variable naming, esp. locals FIXME | ||
- | abbreviations, suffix vs. prefix convention? | + | In general, variable description modifiers should be used as suffixes, rather than prefixes (e.g. //dwelling unit share// rather than //share of dwelling units//). The same is true for variable names |
^ Descriptor ^ Abbreviation ^ | ^ Descriptor ^ Abbreviation ^ | ||
Line 50: | Line 50: | ||
| rate | Rt | | | rate | Rt | | ||
| efficiency | Eff | | | efficiency | Eff | | ||
+ | | plan | Plan | | ||
+ | | actual | Act | | ||