Re: How to name variables in a program?



August Karlstrom wrote:
Note that single letter variable names are generally preferred for (trivial) loop variables as long names obscures the code. Compare

   FOR k := 0 TO LEN(a) DO
      a[k] := 0
   END

with

   FOR arrayIndex := 0 TO LEN(a) DO
      a[arrayIndex] := 0
   END


Oops! `LEN(a)' should of course be replaced by `LEN(a) - 1'.

-- August
.


Quantcast