Introduction
Software developers and programmers are some of the most educated and smart people on the planet. However, even they can have some bad habits which can limit their success and cause problems. According to Matthew Davies, bad coding habits can prevent you from achieving the breakthrough you always wanted and force you to work harder than necessary. So, you must eliminate these habits as soon as possible.
There is no shortage of programmers nowadays and the industry has become much more competitive. So, you cannot afford to make many mistakes.
The Practices
Here are some ineffective programming practices -
- Not fixing mistakes promptly - Many people don’t take prompt action when they spot a mistake in their coding. They simply add the problem to their ‘to-do’ list. It is not a good idea to postpone code fixes unless you have something more important to do. If you don’t fix a code when it is needed, how can you proceed further? It is useless to expect the right results if you know you have made and mistake and not fixed it yet. ‘
- Not formatting or indenting your code - Indenting or formatting your code not only makes the structure of the code more beautiful but it also makes it easy to spot mistakes. Properly formatted code is also much more presentable to other people.
Consider running your code through a code beautifier like ‘Uncrustify’ if you don’t use an IDE that doesn’t format your code automatically.
- Not using names that add information - A good name can allow other coders to understand what your code much more quickly. It is not easy to come up with a good name but if you can add extra information which your code doesn’t convey, it will be helpful to other coders. The goal should be to give a general idea of what your code can do.
- Typos in your code - Typos in code can be a pain to deal with. They are not so easy to spot but can ruin the whole function of your code. Such mistakes are frustrating because it doesn’t have anything to do with coding skills. These are just silly mistakes that are caused due to carelessness.
To reduce typos in your code, you a programmer-specific text edit as they can reduce spelling errors. Alternatively, you can also work in a good, integrated development environment (IDE). It is also a good practice to choose function names and variables which are easy to spells so that you don’t misspell them easily and spot them quickly when you do misspell them.
- Not modularizing your code - In order to keep your functions short, and easy to understand and maintain, you should not let it do more than one thing. Creating long functions can be ineffective as they are harder to understand and test. A good practice is to not let a function occupy more space than a single screen. You should also rewrite the function if it has more than 10 ‘if’ statements or loops.
Conclusion
According to Matthew Davies, if you can only become a great programmer if you follow the proven best practices. Do not ignore any mistakes or put blame on others. Be responsible and strive to improve yourself if you want to taste success.