6 Coding Habits to Adopt in 2024
Tags: beginners, productivity, career, learning
Published: 2023-12-30 10:41:58

<img width="100%" style="width:100%" src="https://media.giphy.com/media/xUySTQZfdpSkIIg88M/giphy.gif">

I'm pretty sure you've heard that developing healthy habits is important for your personal growth and health, but did you know that thinking about your coding habits can also have a big impact on your career? yes that is true, then your code is the culmination of your coding habits and addressing them will not only free up a lot of your time but also advance your career.

so I will guide you to build regular coding habits which help to stay focus and consistent, let get started.

## ***Take the first habit*: the habit of breaking down tasks.**

<img width="100%" style="width:100%" src="https://media.giphy.com/media/8HcT5UwUTT0XtlIvmc/giphy.gif">

First and foremost, I'll share how to break task into small tasks using an example.

Let's say your manager requests you to build an app for the basic E commerce. You agree to work on it, thinking it will only require a few UI screens. However, as you get into the task, you find that there are actually six screens that need to be created, which is a little more than you had anticipated but should still work it out okay.

It appears that you will need to render animations, and you do not currently have a framework for that, also need to construct a pagination system for that. and we'll need to continue regardless of whether the user has seen it or not in order to decide when to show it, presuming that time is not an issue, which it usually is.

You push through this and make a PR for it, and guess what? Your team and the senior engineer will disagree on all of these various things you need to do, so your PR will end up looking messy. Your evaluations will be much simpler to write if you divide your work into smaller, more manageable parts. It will also drive you to think about things like creating more general and reusable component.

<img width="100%" style="width:100%" src="https://media.giphy.com/media/TENGwS5hytGEt66IlO/giphy.gif">

However, there's a catch This advice is flawed if it is applied too early, before the task is split up too much. Instead, try to piece together a rough draft of it first. This is because working on sub task number 6 will reveal something you neglected to address when working on sub task number 1, and if you create a PR for number 1 without first creating a prototype of the big picture, it's likely that you won't meet the target when you try to put everything together—unless, of course, it's something really simple. 

The benefits of developing coding habits are endless, so hopefully you can see the power of doing so. A proof of concept or prototype will give you the big picture, and from there, you can actually extract sub tasks as their own isolated changes and polish those individually.


## The 1% Rule

The beautiful thing about habits is that you don't need to put in a ton of effort up front; you can start implementing them slowly and see them as these sorts of tiny incremental improvements to your coding skills.

![book Atomic Habits](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6xhidgwy9bx72j7s0s8n.jpg)

James Clear refers to this concept as the ***"one percent rule"*** and discusses it in his book Atomic Habits.According to the one percent rule, teams and organizations that maintain a one percent advantage over the competition will eventually accrue the majority of rewards in that field.

This means that you don't need to be twice as good to get twice the results—you just need to be slightly better. The classic example Just consider the power of compound interest in the finance industry to demonstrate this. If you could improve yourself by 1% every day for a year, you would be 30 times better—not 30–30 times better—which is an incredible return for the small amount of work required to improve yourself by 1% every day.

When it comes to code, it's a highly subjective and hard-to-measure discipline, so it could be helpful to consider how we can truly quantify that one percent. You can start with basic metrics like the quantity of pull requests you generate or the amount of PR comments you receive from others. 

![software development](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lmesa9yj12x7s0mjn9d1.jpg)

In the world of software development, those comments—how often do you feel overwhelmed? —probably won't be sufficient, so I like to supplement them with statements like how often you feel productive and accomplished. How many of those comments come from that senior engineer? If you're working alone on projects of your own, just how quickly can you check out features from your to-do list. 

And what do your team and manager think of your performance? It's always a good idea to get their input.This leads us seamlessly to our next habit: solving problems rather than merely trying to recall information is what our brains are meant for.

## the thrill of solving problems!

![sticky note for problem solving](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/79ofadjj7l9clee6yhkc.jpg)

However, here's the deal: in order to be a good programmer, you still need to have information on hand.

I really love the idea of keeping a Dev Journal. Here's one way I love to look at this: you know how we use source control in software development, so things like git, well one of the biggest reasons we do is to keep track of changes in our code and be able to refer back to it. I struggle to remember even my address or phone number, and I've seen opportunities fly by because I didn't have the information, I didn't write it down back then I didn't remember it on the spot, where I wanted to be required of it and I missed an opportunity to help someone. 

This is incredibly helpful, but writing code is just one aspect of being a software engineer. Wouldn't it be great if you could apply source control to everything else you need to do, such as tracking your progress on tasks like organizing designs and specs and having conversations about the product and technical solutions that people come up with useful documentation or references to those obscure stacks?

![Team Discussion](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0fjt5dm9ibv7v2718vz4.jpg)

Overflow threads that address their own narrow issue Developing the habit of taking a few notes every day about things like these before closing your laptop or leaving for home is a really underrated skill.

One day, things like contacts. There's a wide array of people responsible for a wide array of things that might maybe help you with some stuff at some point. Your ability to add value to your team suddenly doubles or triples because you have a word-side perspective of all that has been necessary for you to deliver. 

Whatever program you choose, you first place yourself in a position to be able to support your teammates more effectively by having that knowledge on hand. And guess what? Making an influence on others is another way to advance in your career.

## Be Safe & Stay Alert

<img width="100%" style="width:100%" src="https://media.giphy.com/media/v1.Y2lkPTc5MGI3NjExMzgya2czY3YzMHc3NjFhbDB5ZzQ4bTg5cXJ1dmE1dGw5aGsyMXNhayZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/ob0IRMjeZTT7Dt1ubh/giphy.gif">

Although you may already be aware of this idea, let me give you a little rundown. Generally speaking, while building software, there are two possible outcomes: first, you encounter the 1490 problems during the build process; then, after the build is complete, you test the code and find that it does not function as intended. Which one, presuming there are just a few mistakes and not 1490 something, would you want to have? This is sometimes referred to as type safety: it is usually preferable to detect issues at build time as they are detected far sooner than at runtime.

![Developing the practice of coding](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lvjn189o4a6ac18bapo6.jpg)

Developing the practice of utilizing a language's advantages so that the compiler can assist you in determining whether you're doing anything incorrectly is really important. The simplest illustration is that if a variable's range of acceptable values is restricted, you might obviously, It's a very simple example, but if you consistently apply this consideration to every line of code you write, it's one of the best investments you can make because you significantly reduce the number of things that can go wrong. 

Alternatively, you could use something like a string and check that the value is using a comparison, but the smarter thing to do would be to create a menu with the possible values since the compiler will guarantee that you will never get a value that is not within that list.

## One Task at a time

![One Task at a time](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yg0quqm24a58fzldj4l2.jpg)

I’ve talked about breaking down your tasks, but you can take this a step further by being strategic about how you start tackling the smaller chunks. There are studies still debating this. Once your code is out in the wild, you state yourself and your team a lot of time and again, who couldn't use more time? I love this next habit, which isn't exclusive to coding but is so good that I needed to include it: **eating the frog first.** 

This is going to be true even within coding, as some things will naturally be less engaging than others and the need to get them done can be demotivating. Whether or not we actually have a limited amount of willpower in a given day, we cannot deny that we fundamentally give up on the things that we don't find engaging or when we're feeling drained and we're a lot more likely to procrastinate when this happens.

Regretfully, there isn't much we can do if we simply don't enjoy an activity, but we can always manage our energy more wisely. In the world of productivity, there's an amazing metaphor for this called "eat the frog." The visual is terrible, but that's also what you'll remember, and it basically involves determining which task is the most challenging of the day and finishing it before moving on to any other work.

![A Dog using Ipad](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9c87b9202lf49vzak4bo.jpg)

Since some people are not morning people, a more general interpretation of this would be to save the difficult tasks for when you know you have the energy to complete them, ideally with the least amount of distraction. However, feel free to experiment on yourself at your own risk.

I am willing to take a risk and suggest that you meditate. The issue I am attempting to tackle here is that you are trying to earn a living from a skill that literally depends on your ability to focus. This is true for many other disciplines as well, but it is especially true for hours, and we are rarely deliberate about setting aside time to hone that skill. You are already ahead of many people in this regard, so it's not really a competition with anyone other than who you were yesterday.

If the advantages of their coding weren't enough, I've found that meditation helps greatly with things like anxiety and impostor feeling syndrome. It doesn't have to be meditation exactly.

---

## Bonus Tip: Practice more Often.

![ Practice make man perfect](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/8w9v1wwezxv6vsorp9vo.jpg)

there is a term called Practice make man perfect, it generally true but also the point to be note is to the ***perfect,*** in this world no one is perfect. but you will agree that with practice you can improve yourself, I would concede that with practice, you may become a better version of yourself in both the coding and the other profession that you aspired to excel in.

there is no time period or any specific time. to practice and improve your coding skills. it totally depends on the how much focus your are which your are doing the task at a time. 

---

<img width="100%" style="width:100%" src="https://media.giphy.com/media/5WcpKJct7pDgLzqSji/giphy.gif">

Cheers to 2024! New perspectives and enthusiasm abound in the New Year. As 2024 approaches, fresh starts are waiting to bring happiness into our lives. The arrival of the New Year signals a prosperous future that i hope so may your dream come true wherever you wanted job in FANG Company or wanted to be topper of the class.

I appreciate you taking the time to read and, if you thought this was useful, please consider following. And don't forget to Drop a "💖🦄🔥🙌🤯", I'll see you in the next one.