Common Programming Principles
This page is under construction. This page or section is currently in the middle of an expansion or major revamping. However, you are welcome to assist in its construction by editing it as well. Please view the edit history should you wish to contact the person who placed this template. If this article has not been edited in several days please remove this template. Please don't delete this page unless the page hasn't been edited in several days. While actively editing, consider adding {{inuse}} to reduce edit conflicts. |
A simple internet search for Programming Principles will return many articles. Below is a list of Common Programming Principles that appear on multiple lists.
Keep It Simple, Stupid (KISS)
Keep the code simple. Simple code is easier to read, extend, and maintain. If the code is simple, other developers, or "future you", will be able to understand the code logic and be able to continue with the code.
- Attempt to split complex code into smaller components by using SubVIs
- Remove unnecessary code
- Don't try to write clever code
Write DRY Code
The Don't Repeat Yourself (DRY) principle means to avoid duplication of code. This also pertains to data or logic.
- Use SubVIs for logic used in many places
- Don't duplicate/copy data storage. Inevitably, one of the copies will be out-of-date or wrong.
Open/Closed
Make the code Open to extension but Closed to modification. Organize the code in such a way that it encourages extension but prevents direct modification. This separates core behavior from modified behavior so that if the core behavior is changed, it won't break the extended, modified behavior.