Programming principles¶
These are some general programming principles taken from this article which can also be applied to MPS:
- KISS (Keep It Simple, Stupid) — You may notice that developers at the beginning of their journey try to implement complicated, ambiguous design.
- DRY (Don’t Repeat Yourself) — Try to avoid any duplicates, instead, you put them into a single part of the system or a method.
- YAGNI (You Ain’t Gonna Need It) - If you run into a situation where you are asking yourself, “What about adding extra (feature, code, …etc.) ?”, you probably need to re-think it.
- Clean code over clever code — Speaking of clean code, leave your ego at the door, and forget about writing clever code.
- Avoid premature optimization — The problem with premature optimization is that you can never really know where a program’s bottlenecks will be until after the fact.
- Single responsibility — Every class or module in a program should only concern itself with providing one bit of specific functionality.
- Fail fast, fail hard — The fail-fast principle stands for stopping the current operation as soon as any unexpected error occurs. Adhering to this principle generally results in a more stable solution
General Java design patterns can be found here (very nice illustrations).
Last update:
November 15, 2021