Programming by Permutation
Programming by Accident · Programming by Coincidence
Trying random changes to code until something works, without understanding why. Sometimes called "trial and error debugging" — effective by accident, fragile by nature.
Origin
The exact origin is uncertain, though the programming by permutation antipattern—also called "trial and error," "generate and test," "poke and hope," "the birdshot method," and "million monkeys programming"—emerged in software engineering discourse by the late 20th century. The approach involves iteratively making small changes and testing each to see if it behaves as desired, often when a programmer doesn't fully understand the code or when APIs are insufficiently documented. Programming by permutation gives little assurance about code quality—the polar opposite of formal verification—and easily introduces unrecognized bugs. It's particularly common among junior developers.