If you are into programming or software development, here I discuss three basic principles:
1- DRY: Don’t Repeat Yourself
- DRY is a principle of software development aimed at reducing repetition of software patterns, replacing it with abstractions or using data normalization to avoid redundancy. A basic strategy for reducing complexity to managable units is to divide a system into pieces. The DRY principle is stated as “Every piece of knowledge must have a single, unambiguous, authoritative representation within a system”. In other words, it states that these small pieces of knowledge may only occur exactly once in your entire system. Violations of DRY are typically referred to as WET solutions, which is commonly taken to stand for either “write everything twice”, “we enjoy typing” or “waste everyone’s time”.
2- KISS: Keep it Simple Stupid
- The KISS principle translates to “The simplest explanation tends to be the right one.” The KISS principle states that most systems work best if they are kept simple rather than made complicated; therefore simplicity should be a key goal in design, and that unnecessary complexity should be avoided. There are similar concepts in many areas. Occam’s razor (also Ockham’s razor or Ocham’s razor) is the problem-solving principle that the simplest solution tends to be the right one. When presented with competing hypotheses to solve a problem, one should select the solution with the fewest assumptions. To sum up: try to think out-of-the box if a task looks complicated to you.
3- YAGNI: You Ain’t Gonna Need It
- The YAGNI principle translates to “If it’s not in the concept, it’s not in the code.” If there’s no budget for database abstraction, there’s no database abstraction. If the unlikely event of a database change does occur, it’s a natural thing to charge for the change request (ref). A good rule of thumb is: roughly 80% of the time spent on a software project is invested in 20% of the functionality. Think about your own projects! Everytime I do, I am surprised by the accuracy of the 80:20 rule.
- While this concept may sound simple, it can be hard to differ the necessary from the unnecessary parts. For example, if you’re comfortable with a library or a framework that uses database abstraction, you won’t save much time in dumping it. The key concept is another way of looking at software: we’re trained to write future-proof and maintainable software. This means that we are trained to think ahead. What changes may occur in the future? This is critical for bigger projects, but overhead for smaller ones. Don’t think into the future! If a small corporate website does fundamental changes, they may have to start from scratch. This is not a significant problem compared to the overall budget.
The difference between You ain’t gonna need it and DRY in software development is that the latter is reducing complexity by dividing a project into manageable components, while the former is reducing complexity by reducing the number of components. YAGNI is similar to the KISS principle, as it strives for a simple solution. However, KISS strives for a simple solution by trying to implement something as easily as possible; YAGNI strives for simplicity by not implementing it at all!