Don’t Repeat Yourself (DRY) Principle

Having the same procedure or information in multiple places is a problem for a few reasons, including (Source):

  • The more times you need to write it, the more likely you are to do one incorrectly
  • When you need to change a process or piece of data, it’s a pain to have to do it in multiple locations
  • If you don’t remember to change all of the locations, you’ll end up with an inconsistent system, which can have disastrous consequences (e.g. one part of the code thinks 100% speed is 0.1m/s and requests 100% speed. If the motor controller thinks 100% speed is actually 10m/s, you’ll soon have a collision on your hands!)