So, today we are going to have a look into some well-known programming principles which always come handy while coding.
1. KISS : Keep It Simple Stupid
The following quote has rightly explained it:
Any fool can write code that a computer can understand. Good programmers focus on writing the program in a humans understand.
Martin Fowler
2. DRY : Don't Repeat Yourself
Implement functions for the block of code commonly used in your program and call out the functions as needed rather rewriting the complete code.
3. 4C's : Clean Code, Clever Code
The code we write is a way of our thinking to solve/create a given thing/scenario. It has to be different than the other. So, how do we grasp a thinking which is NOT as same as ours ?
Here comes our third point into play. We must aim for the best readability of our code so that others can understand your way of thinking, your way of coding.
Readability matters.
Tim Peters, (The Zen of Python)
4. YAGNI : You Aren't Gonna Need It
We usually comment the code from our code base thinking that we might need it in future. But, that's rarely going to happen. So, don't just let your code rot over there. You have the power of Git, USE IT !
With that, these are some of the programming principles which can upgrade your coding & programming skills.
Top comments (0)