Whack a Mole - pannous/wasp GitHub Wiki

Avoid wackamole programming

Definition of wackamole programming: fixing one test case breaks another. The Whack-a-Mole Problem Related: technical depth.

Root causes of wackamole programming

  • Adding logic instead of reducing logic
  • convoluted if statements
  • global state
  • side effects
  • lacking purity

convoluted if statements

Every convoluted if statement is a sign of bad design.

DONT ADD LOGIC WHEN IT WORKED BEFORE

Let's say you have a program where all tests are passing you add functionality in another module, you add a tweak in the main module and suddenly the tests are no longer passing. Under (almost) no circumstances shall you add another layer of logic to the main module in order to make the old tests pass. Instead you should try to make the new module compatible with the existing code.