Member-only story
7 Software Development Principles That Should Be Embraced Daily
“KISS,” “DRY”, “YAGNI,” and more
Being a good programmer is a mix of skills and some common sense. It is all about being pragmatic and knowing what is the solution that fits better your problem. When facing a challenge, there are some software principles that will guide you in choosing the most correct approach.
Those are a set of guidelines every developer should know and revisit from time to time. Think about them as your secret sauce when programming.
Consistently applying those principles will make your transition from mid to senior software engineer easier. You may find out that (probably) you are applying some of them intuitively.
There are a lot of principles. We will just focus on the seven most important ones. Embracing these will help you improve and become a better programmer.
1. You Aren’t Gonna Need It — YAGNI
It’s simple and self-explanatory — but not everybody follows it. When adding code, make sure it’s needed right away. Don’t leave code hanging because you think it might be useful later on.
This applies when doing refactoring. If you refactor a method/class/file, you shouldn’t be reluctant to remove any methods that are left hanging. Even if they were useful in the past — they are not anymore.
A day may come when they are needed again, and you can use the git repository to bring them back from the dead.
2. Don’t Repeat Yourself — DRY
This concept was first formulated by Andy Hunt and Dave Thomas’s book The Pragmatic Programmer: From Journeyman to Master.
The idea revolves around having a single source of truth. What is that anyway?
“In information systems design and theory, single source of truth (SSOT) is the practice of structuring information models and associated data schema such that every data element is mastered (or edited) in only one place. … SSOT systems provide data that are authentic, relevant, and referable.”
— Wikipedia