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 16:02]
marcus.williams
howtos:toolcoding:good_practices [2010/11/08 16:01]
marcus.williams
Line 24: Line 24:
 Object consolidation is when multiple objects are combined into one along a certain dimension. ​ In this example, we will create an object fuelUseAll[tm],​ where dimension tm is transportation mode (air, rail, car).  Assuming that we have calculated the fuel use for each mode so that we have the objects airFuelUse[],​ railFuelUse[],​ and carFuelUse[],​ we can create fuelUseAll[tm] in two ways: Object consolidation is when multiple objects are combined into one along a certain dimension. ​ In this example, we will create an object fuelUseAll[tm],​ where dimension tm is transportation mode (air, rail, car).  Assuming that we have calculated the fuel use for each mode so that we have the objects airFuelUse[],​ railFuelUse[],​ and carFuelUse[],​ we can create fuelUseAll[tm] in two ways:
   - <​code>​fuelUseAll[tm] = insert (airFuelUse[];​ transMode:​air)   - <​code>​fuelUseAll[tm] = insert (airFuelUse[];​ transMode:​air)
-fuelUseAll[tm] = insert (airFuelUse[]; transMode:​rail) +fuelUseAll[tm] = insert (railFuelUse[]; transMode:​rail) 
-fuelUseAll[tm] = insert (airFuelUse[]; transMode:​car)</​code>​+fuelUseAll[tm] = insert (carFuelUse[]; transMode:​car)</​code>​
   - <​code>​local airFuelUseAll[tm] = copyshape (fuelUseAll[tm])   - <​code>​local airFuelUseAll[tm] = copyshape (fuelUseAll[tm])
 local railFuelUseAll[tm] = copyshape (fuelUseAll[tm]) local railFuelUseAll[tm] = copyshape (fuelUseAll[tm])
Line 31: Line 31:
  
 airFuelUseAll[tm] = insert (airFuelUse[];​ transMode:​air) airFuelUseAll[tm] = insert (airFuelUse[];​ transMode:​air)
-railFuelUseAll[tm] = insert (airFuelUse[]; transMode:​rail) +railFuelUseAll[tm] = insert (railFuelUse[]; transMode:​rail) 
-carFuelUseAll[tm] = insert (airFuelUse[]; transMode:​car)+carFuelUseAll[tm] = insert (carFuelUse[]; transMode:​car)
  
 fuelUseAll[tm] = airFuelUseAll[tm] + railFuelUseAll[tm] + carFuelUseAll[tm] fuelUseAll[tm] = airFuelUseAll[tm] + railFuelUseAll[tm] + carFuelUseAll[tm]
Line 41: Line 41:
 ===== Variable Naming ===== ===== Variable Naming =====
  
-Stub: best practices for variable naming, esp. locals+Stub: best practices for variable naming, esp. locals ​FIXME
  
 abbreviations,​ suffix vs. prefix convention? abbreviations,​ suffix vs. prefix convention?
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