DEV Community

Cover image for 7 Bad Coding Habits You Should Leave Right Now
Mr. Unity Buddy
Mr. Unity Buddy

Posted on • Updated on

7 Bad Coding Habits You Should Leave Right Now

Hello, buddies! Bad habits are hard to break and even harder if you don't realize that what you're doing is undermining your work. If you know but don't care—that would be the worst. You lucky buddy, you are in the right article. Here are the 7 coding habits you might have and if you have them, drop it right now.

1. You don't focus on one language

image.png
To be a good programmer, you should master a language. A language about which you know everything. If you are good at Python, master Python first and after that go to another language. learn step by step. No one doesn't know everything 😉

Instead of learning different languages, one should focus on mastering one language.

2. Acting like you have all the answers.

image.png
It is good to be confident in life. But in programming, it is better to keep checking on the code you are working on.

Knowing everything is okay. But it doesn’t mean that you won’t make any mistakes. When you are dealing with a big project, it may possible that there is a little syntax error. Being overconfident on what you know will lead you to make little mistakes.

3. Refusing to ask for help/questions

image.png
Not every time you can solve all the problems by yourself. The best programmer knows when to ask for help.

While working in team projects, asking help from your team members will help you in interacting with them. You will able to know the abilities of your team members.

In this article, @Ayodele Samuel Adebayo shows you 10 reasons why you should ask questions!

4. Refusing to write bad code

image.png
There comes a time in every developer's life when deadlines will force you to write terrible code, and that’s okay. You’ve tried warning your client or manager about the consequences, but they insist on sticking to the deadline, so now it’s time to code. Or perhaps there’s an urgent bug that can’t wait for you to come up with a clean solution. That’s why it’s important to be versatile as a programmer and to be able to write poor code very quickly as well as good code.

5. Not sharing with your team what you’ve learned

image.png
The value of a developer is not only placed on the code you write, but also on what you learn when writing it. Share your experiences, write comments about it, let others know why things are the way they are, and help them learn new things about the project and its intricacies. Unofficial teams may look this as a joke and It's OK. You did your job and that's it!

6. Blindly copy/pasting code

image.png
Getting help for StackOverflow is OK but, understand code before you reuse it. Always compare your code with it. Sometimes you don't immediately notice everything the code is doing at first glance. You will also learn more about a problem when you take the time to read the code in detail.

7. Saying, “I’ll fix it later”

image.png
Last but not least. The habit of postponing code fixes is not merely a problem of priorities. Organizing your issue tracker might generate some progress, but you also need to have a way of tracking smaller issues that come up. Adding “TODO” comments is a quick way of making sure you don’t miss anything.

So here are the 7 bad(worst) habits you should drop right now. Happy Coding!

Originally published on Hahshnode

Discussion (0)