Learn Programming: What are bad coding habits you would tell others to avoid? (Discussion Topics) - ByteScout
  • Home
  • /
  • Blog
  • /
  • Learn Programming: What are bad coding habits you would tell others to avoid? (Discussion Topics)

Learn Programming: What are bad coding habits you would tell others to avoid? (Discussion Topics)

Programming is like starting with a blank canvas which means that there is a lot of uncertainty from the beginning. Just like how an artist strokes his paintbrush to make a masterpiece, a programmer uses his keystrokes to create an application. In the same vein with art, programming involves recognizing patterns and learning from mistakes. Like any skill, it requires lots of practice.

There’s a lot of information on the internet focused on advice about learning how to code. Make sure to find reliable online resources since there is such an overload of content. Some programmers swear by resources such as Stack Overflow which is an open community for any programmer.

Programming Habits - Bad Coding

They help with answering coding questions and sharing knowledge. From such communities, you can get peer feedback and even find passionate mentors. It never hurts to have a fresh set of eyes review your code for bugs, so don’t be hesitant to ask for help if needed. Since we all make mistakes now and again, so it’d be helpful to make a list of things other programmers should avoid.

Debugging mistakes sometimes originate from comparing yourself to others. This can impact your work since you might feel as if you are making slow progress. However, programming is a learning curve, it is a skill that takes time to master so patience is needed.

Some passionate programmers enjoy it simply because it is challenging. But this does not mean you should become a hardy perfectionist. For instance, one of the lessons we learned the hard way was not to change too many things before coming to a stable point you can test.

A pro tip is always writing code that is clean and clear. Ensure you have chosen a primary coding practice such as DRY or WET code. Make sure to stick with it. It is important that the code you pen down will be understandable now and in the future. A lot of programmers advise that writing code you can be proud of is key. Also, avoid writing an algorithm with a data set.

Learning programming means you will get stuck at some point and it can be challenging. These moments can be caused by simple mistakes such as typos and they happen to the best developers. However, it is fine to make mistakes. There will be instances where you can muscle through and solve the problem on your own while other times you may need to research or find help.

Yet, a good coding habit that can help overcome this challenge is making comments on your code. These comments should be clear and insightful not obscure names that might confuse you when returning to the code.

Another useful tip is to avoid getting overly frustrated. Every skill indeed needs practice but regular breaks and rest are required to increase productivity. Focus timers can help you keep track of time and have the needed breaks to keep the mind and eyes fresh. Having obscure variables can also lead to frustrations when reviewing the code so make all the programming work is neat, it will save you time in the future.

What are bad coding habits you would tell others to avoid? We have already explored these mistakes and how to resolve them. The following however is a summary of these discussion topics.

  1. Sort of like you said, “Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” I know it’s a pain to crawl through your code, but your future self will thank you.
  2. Please avoid writing an algorithm with a data set, find new data that is different from current and write an if statement to handle it. It’s fine the first time you do it, but the more errors you find and deal with this way, the more difficult your end code will be to actually read. Remember to write code you will be proud of.
  3. Make comments throughout! Even if you don’t think it’s necessary. Chances are you’ll have to go back through it eventually and you’ll save yourself the trouble of figuring out what’s going on.
  4. Giving obscure names to your variables. Sure you might know what it means at this moment, but what happens if you need to come back to it later? It’s probably going to make zero sense and a whole lot of frustrations.



About the Author

ByteScout Team ByteScout Team of Writers ByteScout has a team of professional writers proficient in different technical topics. We select the best writers to cover interesting and trending topics for our readers. We love developers and we hope our articles help you learn about programming and programmers.