Programming by permutation
Appearance
Trying to approach a solution to a programming problem by iteratively making small changes (permutations) and testing each change to see if it behaves as expected is called "programming by permutation". This approach sometimes seems attractive when the programmer does not fully understand the code, and believes that one or more small modifications may result in code that is correct.
This tactic is rarely productive because:
- a series of small modifications can easily introduce bugs into the code, leading to a "solution" that is even less correct than the starting point
- many changes are usually required to arrive at a satisfactory endpoint
- it is rarely possible to measure, by empirical testing, whether the solution will work for all cases
- in the worst case, with poor code management, the original state of the code may be irretrievably lost