Here are some most common bad programming practices that every programmer should avoid to become a better programmer.
1. Giving up too soon
Most of the programmers give up when they are very close to solution. So never lose hope and keep trying, you will definitely find a solution.
2. Acting defensively when someone critiques your code
Be calm when someone criticizes your code. Just listen carefully to them; maybe it will help you to improve your code quality.
3. Refusing to ask for help
Don’t be ashamed of asking help from other programmers. Don’t feel that others will think you even don’t know such a small thing. Just go ahead and ask for help. There are several programming forums like stackoverflow where many experienced programmers are active who would definitely help you.
4. Passing blame to others
A good developer is one who takes ownership and responsibility for the code he/she write.
5. Ignoring the opinions of other developers
Pair programming with other experienced developer is one of the best ways to learn and grow as a developer. You can take help of other programmers and senior developers to learn efficient ways of solving a problem that you have solved yourself.
6. Not knowing how to optimize code
Finding solution of a problem should not be your only concern. You should optimize your code in terms of time and space complexity.
7. Acting like a boss, not a leader
If you are a senior developer then you should know how to manage developers in your team. You should act like a leader who can properly lead his/her team.
8. Using the wrong tool for the job
You should be aware of which tool is best for the job. Stop making decisions based on “it’s what I know”. You need to be open to using different technologies, languages, and frameworks.
9. Refusing to research coding questions
Internet is one of the most powerful tools for programmers. You should be really smart to search solution for a problem on sites like google, stackoverflow, etc.
10. Refusing to learn from mistakes
We are humans, we make mistakes. Making mistake is not a bad thing, but refusing to learn from them is bad thing. Find the ultimate cause for the mistake and keep it in mind so that you will not repeat it in future.
11. Separating yourself from the developer community
You should be really active in developers and programmers community. This will help you to have knowledge about latest technologies and trends in the market.
12. Not giving back to the community
You should be always ready for helping other programmers. You can help others by various platforms like stackoverflow, quora, etc. or by writing articles on others or your own blog.
See how I am helping other programmers by this blog.
13. Struggling for hours to solve something, solving it, and not documenting it
You may get some strange problem whose solution is not there on internet. You spent several hours and found the solution. Now it’s your duty to share the solution on internet so that others will not struggle that much.
14. Bad naming conventions
Use meaningful name for variables, functions, classes, etc. For example, using characters like x, y, z, etc for the variable name instead of something like length, userInput.
15. Writing too many or not enough comments in code
Comments are essential notes to developers. It increases the readability of code. You should properly write comments so that it will help you as well as other programmers to understand the code in future.