How to Write Clean and Maintainable Code
HOW TO WRITE CLEAN AND MAINTAINABLE CODE
1. DRY (Don't Repeat Yourself)
- is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy.
2. YAGNI (You Aren't Gonna Need It)
- is a principle of extreme programming (XP) that states programmers shouldn't add functionality until it's deemed necessary.
3. KISS (Keep it Simple, Stupid)
- as a design principle states that most systems work best if they're kept simple rather that made complicated. Therefore, simplicity should be a key goal in design, and that unnecessary complexity should be avoided.
- Writing useful and necessary comments will help our code cleaner.