Important Computer Science Principles - Dutton-Christian-Robotics/Learning-to-Code GitHub Wiki
Don't Repeat Yourself
One of the most common words of wisdom in programming is "don't repeat yourself"—or DRY. There are many reasons that this is an important principle.
- The more you repeat yourself—that is, writing the same code over and over—the more places and opportunities there are to make mistakes.
- If there are basic things that you always do over and over, there are opportunities for saving time, lines of code, and helping you to focus on a higher level of programming by taking repeated code, simplifying it, and turning it into a function/method.
Separation of Concerns
Another key principle builds off of dry: the "separation of concerns." This principle suggests that rather than have one section of code that does a lot of things, make those into separate sections instead.
In the context of robotics, SoC suggests that you shouldn't have your OpMode do all the work of both setting up your robot and then running the commands that constitute the actions during game play.