User Tools

Site Tools


howtos:toolcoding:good_practices

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

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:33]
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
  
-abbreviationssuffix vsprefix convention?+In generalvariable 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, but for these modifier abbreviations are recommended to keep name lengths manageable (e.g. ''​dwellUnitShr''​). A table of suggested abbreviations is provided below:
  
 ^ Descriptor ^ Abbreviation ^ ^ Descriptor ^ Abbreviation ^
Line 50: Line 50:
 | rate | Rt | | rate | Rt |
 | efficiency | Eff | | efficiency | Eff |
 +| plan | Plan |
 +| actual | Act |
  
  
howtos/toolcoding/good_practices.txt ยท Last modified: 2011/06/17 18:42 by chris.strashok