Understanding list of coding principle
Ask by ICSM Computer
Updated 28 Apr 2025
There are many other software design and coding principles that help guide good programming practices. Here’s a list of additional important coding principles that developers often follow:
DRY (Don't Repeat Yourself)
Why?
Helps maintain code. If something changes, you only need to update it in one place.
KISS (Keep It Simple, Stupid)
Why?
Simple code is easier to read, debug, and maintain.
YAGNI (You Aren’t Gonna Need It)
Why?
Avoids overengineering and keeps the codebase lean.
Separation of Concerns (SoC)
Why?
Improves readability, maintainability, and testability.
Law of Demeter (LoD)
In Code:
A method should call methods only on:
Why?
Reduces tight coupling and improves encapsulation.
Composition Over Inheritance
Why?
It’s more flexible and avoids deep and fragile inheritance hierarchies.
Design for Testability
How?
Principle of Least Astonishment
Why?
Helps make APIs and systems more intuitive to use.
Clean Code Principles (Robert C. Martin’s guidance)
Fail Fast Principle
Why?
Makes debugging easier and improves software reliability.
Tell, Don’t Ask Principle
Example:
Bad:
Better: