To be a good programmer you need the ability to be logical in thinking. But, along with that if you can follow some basic programming principles you code appears and run neatly without issues. There are several Programming Languages that are in demand in the IT companies and anyone can write code but what is important is to write good code and that’s where it gets tough.
As, a programmer you should not just focus on writing code that works. But, your aim should be to write code that can be maintained by anyone else who might end up supporting your product. Otherwise, in the end you will be looking for Why are most of the IT engineers frustrated in their life?
Here are some Basic Programming Principles:
KISS (Keep it Simple, Stupid): This principle is highly advisable in medium-to-large programming project, as simplicity of code should always be the key goal. Because, if your code is not complex there are less chances of having bugs and error as well as it will be also easier to modify as per the new requirement.
YAGNI (You aren’t going to need it): You should do the simplest thing that could possibly work and provide the desired result, in shot do not try to add unnecessary functionality until you need it. If, you follow this principle it helps you to keep your design simple.
DRY (Don’t repeat yourself): To have a clean and easy to modify code it is one of the most basic principle that you should avoid repetition. There are several programming constructs that exists to help you abstract all the requirement in a function, that way you can easily edit the code at one place if there is a change required.
Open/Closed: You should write entities (functions, classes, modules etc.) in such a way that it should be open for extension but close for modification. So, the next programmer who is going to maintain the code can very well use it with ease.
Single Responsibility: This principle of single responsibility is to focus on having components of code (e.g function or class) in a program for a specific responsibility. Thus, it would perform a single well defined task and multiple features and new behaviors needs not to be added there.
Least astonishment: You should write the code in such a way that it would not surprise the end user while working on the User Interface. This can be achieved by adding proper comment and standard conventions methods.
If, you are just starting out you can look for easy programming languages for beginners. But, as you grow up in career you would understand that to be a good programmer, you have to understand that your product should not only serve the end users but it should be also manageable by your fellow programmer.
Focus on learning how to write code without stress and keep checking our Information Technology and Programming section for more updates.
You might also like our TUTEZONE section that contains exclusive articles on how you can improve your life using technology. Trust me, you will be glad that you paid a visit there.