Software design principles are a set of guidelines that helps developers to make a good system design. Common software design principles are given bellow:
- DRY (Don’t Repeat Yourself)
- KISS (Keep it simple, Stupid)
- YAGNI (You aren’t gonna need it) /You are not going to need it
DRY (Don’t Repeat Yourself)
DRY is the basic principle of software development. Its main aim is to reduce repetition of code. This principal states that each small pieces of code (knowledge) may only occur exactly once in the entire system. Its help us to write scalable, reusable, maintainable code. Example: Asp.Net MVC frameworks works on this principle.
KISS (Keep it simple, Stupid)
KISS states that keep coding simple and straight, so that others human can understand it. Keep your methods small. Each method should never be more than 40/50 lines. Each method should only solve one small problem, not many use cases or problems. If you have lot of conditions in a single method, break them into small methods. It will be easier to read, maintain, and bug finding.
YAGNI (You aren’t gonna need it) / You are not going to need it
YAGNI states that always implement things when you actually need them. Never implements things before you need them. Write your code based on current demand. Not write code for future needs. While writing your code keep software design principles in your mind and use them wisely. It will save development time and make your software robust which could be easy to maintain and extend.
Hope you all enjoyed it very much. Consider the design principles while designing your application. Your valuable feedback, comments are always welcome.