Ground rules for spatial operations algorithm development (cont’d)
GR 7: Use good programming practices:
- modern compilers can repair bad programming practices but do
- compute global constants once at start up,
- compute local constants once at the highest loop level,
- coding of the publication form of an algorithm is some times referred to
as a naïve implementation. Never code the publication form of an algorithm
without considering the computational aspects. Use trigonometric identities to
simplify, avoid power functions, logarithms, exponentials by re-formulation.
Seek competent counsel if you lack experience,
- naïve formulations and implementations are common in the literature
and even in authoritative codes. Many times the conclusions of a publication
are completely wrong due to the use of naïve implementations.