Sunday, 11 October 2026

KISS, DRY, SOLID, YAGNI — A Simple Guide to Some Principles of Software Engineering and Clean Code

1 — KISS (Keep It Simple, Stupid) 

Simplicity triumphs over complexity. Direct and clear codes are better for developing, maintaining, and scaling, turning simplicity into a form of efficiency.


 2 — DRY (Don’t Repeat Yourself) 

Repeating code is an invitation to problems. Keep your logic in one place to avoid errors and facilitate maintenance, ensuring consistency.

3 — YAGNI (You Aren’t Gonna Need It)

Avoid creating functions that are not essential. Focus on what is really necessary, keeping the code simple and direct. The YAGNI practice is important for two main reasons:

  • Time Savings: You stop spending time developing functions that you may never use.
  • Cleaner Code: Your code becomes clearer and free of assumptions that often turn out to be wrong

4 — TDA (Tell, Don’t Ask)

The TDA principle suggests avoiding asking the object about its state; instead, tell it what to do based on the decision, that is, tell the object what to do.


5 — SOLID

SOLID is a set of five fundamental principles of software design in object-oriented programming. These principles guide developers in creating more readable, flexible, and sustainable software systems. These are not rules, but rather suggestions that will facilitate the life cycle of an application and code.


  • S) Single-responsibility principle (SRP): Each object, class, and method needs to have a single responsibility.
  • O) Open–closed principle (OCP): Software entities should be open to extension but closed to modification.
  • L) Liskov substitution principle (LSP): Objects of a superclass should be substitutable by objects of their subclasses, and the application should still function as expected.
  • I) Interface segregation principle (ISP): Software should be divided into several independent parts.
  • D) Dependency inversion principle (DIP): We should rely on abstractions, not concrete implementations.



Ref: https://medium.com/@hlfdev/kiss-dry-solid-yagni-a-simple-guide-to-some-principles-of-software-engineering-and-clean-code-05e60233c79f

No comments:

Post a Comment

KISS, DRY, SOLID, YAGNI — A Simple Guide to Some Principles of Software Engineering and Clean Code

1 — KISS (Keep It Simple, Stupid)  Simplicity triumphs over complexity. Direct and clear codes are better for developing, maintaining, and s...