fbpx

8 Coding Habits you Have to Stop Doing Now

Some habits are stopping you from reaching the pinnacle of greatness. It might be your attitude, your process of working or recklessness. Whatever it is, the first step that will help you become a better programmer is to be aware of bad habits.

The term habit is most often used to refer to a process whereby situations prompt action automatically, through activation of mental situation-action associations acquired through prior performances. Most people want positive habits to be as easy as brushing their teeth, but it’s not that simple. What you need is a will to change yourself, to admit that you’re not doing something right and to make little sacrifices. But you’re making these sacrifices for yourself, don’t forget that.  

Are you ready to become a better programmer and change the way you think about your code? Let’s break these bad habits!

1. Being extremely confident in your own code

It’s one thing to be confident about your work, but it’s another to assume that just because you wrote something, it must be great. Ego is an obstacle to your work, so you should accept suggestions from other colleagues. You have to be aware of the fact that the learning process never stops. Otherwise, that would be the end of your creativity and greatness. Next, stop judging others code. Maybe you would do it differently, but that’s not a reason to act like a jerk. You should take a look at your old code from time to time, reflect on how you’ve progressed and realise that everyone has its own way of developing in their job.

bad coding habits
Take a look at your old code from time to time and reflect on how you’ve progressed

2. Blindly copy/pasting code

At the beginning of the career, every programmer does that, but this blindly copy/pasting code has to stop eventually. Maybe your creativity is blocked, or you have some other reason for doing that. Nevertheless, you have to understand the code before you reuse it. So, take your time and read the code in detail.

3. Being stuck doing the same things  

IT industry is continuously developing, so you have to stay up-to-date with new technologies. Nevertheless, every developer had a moment in their career when they were stuck doing the same thing over and over again. Working with the same framework and language can lead to going downwards in terms of learning new things. Moreover, it can lead you to burnout. You might be just stuck in a company that doesn’t give you an opportunity to try new things, or you might be focused on hitting extreme deadlines. No matter what the reason is, you have to find time to expand your knowledge by thinking about how things work and reading about their underlying issues. If you want to keep your job and stay on the top of this competitive market, you have to follow new trends from IT industry.

Learn How to Keep your Skills Up-to-Date as a Developer

4. Doing things half-way and forgetting to fix it

I’ll fix it later excuse will only bring you a confusion. This is not a problem of priorities, but your organisation skills. If you plan to finish something latter, you have to add “TO DO” comment in order to make sure that you don’t forget about it. Remember, “done” means tested and approved by the user as per his requirements. If you’re good at your job, you know that every piece of code is important and you’ll question the design and ideas behind features to solve for a solution. However, bad developers think that a single method or process is the “ideal,” and that user experience and situation aren’t that important. So, stop marking tasks as “DONE” if you haven’t actually finished it.

5. Ignoring error messages

The error message is telling you that something is wrong, so don’t just assume that you know what’s wrong, but read the message!  Don’t sweep things under the rug because the challenge of fixing it will be many times greater, considering that you won’t have a clue where to begin. More information you have about the bug, easier will be for you to fix it. A-level programmers realise that errors are a good thing. So, don’t let them bother you, but look at them as helpers who will guide you to progress even more. Change the attitude about bugs and deal with them.

6. Writing code without planning or planning too much

One of the biggest mistakes is to start writing code right away without much thinking and researching. Writing the code shouldn’t last longer than planning what you gonna do. When you have a plan, writing is easy, so you have to do a research first. When you do that, you can start writing, validating and modifying the code. If you have a clear picture of what you’re going to do, your creativity will make big things happen.

However, do not look for a perfect plan. That can lead you to procrastination, and as you probably know, there is no such thing as a perfect plan in the programming world. Your plan might change, but that doesn’t mean that you should do random things. So, plan small features, think about your next step, fix bugs and adapt to changes. Keep in mind that too little planning and too much planning can both hurt the quality of your code.

7. Thinking that longer code is better than a short one

In most cases, shorter code is better. Always think about the quality and readability of the code. If it’s good for readability, then write a longer code, but don’t intentionally make the code longer when it does not need to be. Delete what’s unnecessary, but skip using clever one-liners and nested ternary expressions just to keep the code shorter.

  • Good code is short, simple, and symmetrical – the challenge is figuring out how to get there. – Sean Parent

You’re making a number of little decisions while trying to solve a greater set of problems. Will you write short or long lines of code depends on your preferences, skills, and expected outcomes.

coding habits
Always think about the quality and readability of the code

8. Not trying to find a solution outside your head

There is always a possibility that you’ll get stuck while coding, but think about how many people could have the same problem as you do. Watching the same lines of code over and over again and not seeing what’s wrong is a common thing, so just try to google the problem or ask a colleague for help. Do not assume that you know everything because that attitude won’t save you time. Do online research and see what other developers have to say about your problem. Nevertheless, you should question everything you read because some people are just copying and using others code without understanding it.

Conclusion

Every minute you make some small decisions. As a programmer, it’s important for you to have clear thoughts about what are you doing and how. Do not think about programming as writing lines of code because programming is logic-based creativity that needs nurturing. When you’re stuck, take a break and make small plans about what are you going to do next.

Are you looking for a job in IT industry? Finding a job is always easier with the help of IT recruitment company. Take a look at our job board or contact us!

Recruiting software
Emotional Intelligence in Recruitment
assessing cultural fit