2007-10-10 by tamberg
|
Iterating Array Elements BackwardsTo illustrate the sort of nit-picking we spend our energy on, consider this example from back in the days when we programmed in Component Pascal and Given an array
A straight forward approach to iterate through it would be
Preventing multiple calls to the property method
If there's no fixed processing order we can further eliminate a variable
And finally, reordering the decrement we can get rid of the ugly
The latter two examples use the variable name |