“Successful people are simply those with successful habits.” -Brian Tracy
Good habits cause improved personal life, family life, school life, career, and more. That is because many things in life need consistency for better results, and better results can mean “a better way of living life” or “success.”
And, of course, developers should also practice good habits in programming. Developers also need to practice certain habits until they are hard to break to live an efficient programming life.
Let’s talk about these five good and important habits every developer should do.
1) Have a strategic plan before coding
“First, solve the problem. Then, write the code.” -John Johnson
When doing something or having goals, it’s always good to lay out a solid plan. This way, it’s easier to see each step of the way until you reach that goal. As Benjamin Franklin said: “If you fail to plan, you are planning to fail!”
Planning gives you the following benefits:
As mentioned earlier, you would see each step of the way to your goal. Thus, planning lets you see your next step. It’s like having a map in a maze, knowing which direction to go and what to do next.
When you know what to do next, you’ll finish faster. You won’t have to meet a couple of dead ends like you would have without a map. You’d be able to avoid dead ends during your planning.
If you’re going for a promotion and would need to be competitive, planning before coding will help you become a more efficient programmer. And this might lead to that promotion you’re going for.
When you have a sense of direction that’s giving you the speed you need to finish what you are doing, you become more confident in your work. Planning is not only like a map; it’s also like a light in the dark. You are confident in your direction and your speed because you are seeing your next steps, and you know what you’re doing is right.
Programming is complex sometimes — if not most of the time. Sometimes even when you plan to do what you think is right, it may not work, or it may not solve the issues. That’s why strategic planning is essential. It helps you become more flexible when you’re in a tight spot. You think and plan about “if and else” cases. You have plans A, B, C, or more just to make things work instead of guessing on the spot.
2) Write human-friendly codes
“We want the reading of code to be easy, even when it makes the writing harder. Of course, there’s no way to write code without reading it, so making it easy to read actually makes it easier to write.” -Robert C. Martin
Human-friendly codes not only help you understand your codes now, but it is also for your future self. Make your codes manageable not just for yourself but for future developers who would handle the project you are working on now. Human-friendly, manageable, clean codes also help your supervisor review your codes easier and faster. That’s also a plus point in your performance rating (if your company has a performance rating).
Here are some ways how to improve your codes:
- Use consistent formatting and indentation
- Use clear and easy-to-remember variable and method names
- Reduce duplicate codes
3) Put comments on your code
“Why take notes? The obvious reason is to remember.” -Tom Wujec
A developer career is not just one project forever. You’d have multiple of them, sometimes one at a time, other times, you’d have to work and go back from one project to another.
It will be confusing! You might come to a point where you forget the code you wrote last week, the other day, or maybe yesterday, and sometimes even the code you wrote just this morning. Unless you’re a genius and remember every code you write
That’s why commenting and taking notes on your codes are important. Not because your codes aren’t clean, nor are they hard to read, but because you want to be reminded easily — without having to read multiple codes.
4) Do Version control
“Time travel would give humanity the ability to alter the past… with enough revisions humans would eventually bring about the one version of history that was fully good.” -Dexter Palmer.
We are not perfect; we make mistakes — multiple of them! And you can’t help that in programming. Although developers are not time travelers, we can still revert to the best version of what we have made and correct our current mistakes.
That is if we do version control.
Save your original code before making minor or major edits and changes. When you make the change, save it again and compare both versions. If the original version is better, version control can help you revert your code to its original version.
Going back to the “Plan A, B, C, or more” analogy. Imagine all of them are leading you to a dead-end, and you really have to put more effort into reaching your goal. You are already on plan C, and you feel like Plan A is still the easiest way to move on from where you are. Let’s say it has a lower wall you can climb to compared to the other options.
That’s how version control works; it helps you take a step back if Plan A still feels better or easier than your other plans. Have a habit of saving until you get the best version of what you are trying to program.
Learn how to do version control here.
5) Spend 30 minutes to learn more and practice
“Learn continually — there’s always ‘one more thing to learn!” -Steve Jobs
Learning and practicing are important habits. It’s good to be a master of what you already know. But you should also educate yourself with other technologies or languages and pick up new skills. Spending 30 minutes or so a day learning and practicing would be enough. You don’t have to rush your learning unless you are required to by your company.
Here are some of the benefits of knowing multiple languages:
- You stay updated.
- You become a versatile developer.
- Increase salary potential
Create a habit of learning continuously and practicing every day. Knowing more technologies in the tech industry is never a disadvantage but an asset.
You can start learning the top 5 programming languages.
Build good habits
“The capacity to learn is a gift. The ability to learn is a skill. The willingness to learn is a choice.” -Brian Herbert
Starting to build habits can be quite hard, but consistency will be more challenging. But like the quote above, it’s always up to you; your willingness, desire, and motivation.
Having good programming habits also help other people and reap good results and career benefits. That’s why you should build good habits that become a part not just of your daily life but also a part of you. That means programming habits that are hard or almost impossible to break because it is part of who you are as a developer and not just a part of your day.
Lastly, build good habits that make you the best version of yourself.