5 Tips to Be a Better Programmer
A lot of people ask me how they can become a better developer. This is why in this post I want to share with you my 5 tips how you can become a better programmer.
It is not enough when code just works
So tip number one is that code that works is not enough. And a lot of developers especially beginners are satisfied when their code simply works. Because actually they spend so long trying to implement something. And this is completely normal.
But what is not normal is your attitude because actually your first code will be for sure bad.
It will not be clean, not perfect and for sure not the best way possible. But it is totally fine to write code like this because actually your first implementation of something must be a dirty prototype. It doesn't matter if you are a beginner or an advanced developer I highly recommend you to always first write a dirty prototype without a lot of thinking about naming, about best possible implementation because actually you can't write your best code just from scratch. It is simply not possible.
It is really difficult to imagine in your head the whole feature with it's own complexity and difficult cases. This is why typically we want to write dirty prototype first. And it should work but obviously it is not the final stage. The next point will be to see this prototype, analyze it and then think how we can improve it. And especially if you are a beginner I highly recommend you to look on your code and try to improve it several times because as the beginner it is super difficult to understand what is the best possible way to implement something. So it is not enough to just write code that will work your code must go through some stages to be perfect.
Read lots of code
My second tip to become a better developer is to read lots of code. And actually not a lot of people are doing this. Why is that? Because we are focused just on our own code and we are just writing something.
Which actually means it is more difficult for people to read code of other people and understand it.
And it is super important because actually when you read somebody's code, you first of all see another approaches, another architecture you can get other ideas about implementation. Which means it is super important for you as a developer to improve your skills. But it is not only that.
When you are just reading code you can grasp code faster, you can understand documentation faster and you can learn new things also faster just because you are used to read a lot of code. And one of the really nice approaches to read code is to study code base of the project and secondly study pull requests.
So if you just come in the new company and you see a project with some code base you must understand it really on a good level. It is not just enough to open some class and write some code inside and think that you are good. You actually need to understand the whole project and how it works from start to the end.
And yes it might be really difficult especially if the project is really huge but take your time. It might take a week or maybe even more it doesn't really matter. The main idea is that you must fully understand how the project where you are working is functioning.
The approach that I see in a lot of developers they don't try to understand the code base they simply throw some code here and there and try to make things working.
This is not how you should proceed because actually if you don't understand how something is working from start to the end it is super difficult to fix it or implement something new there. And exactly the same I can say about pull requests. If you for some reason don't check pull requests of other people in your team I highly recommend you to start doing it or ask if you can do it or at least read the pull request of other people when they are creating them even if you don't review them. In this case you will learn how other people are writing code, how they structure it, what patterns they are using and you will improve your own code.
Your code is not your child
My tip number three is that your code is not your child. It is completely fine to throw your code away. It is completely fine to discuss your code with other people and you must be sure that your implementation is not the best one. I totally understand when beginners love their code just because they wrote it.
They put so much time knowledge and effort in it. This is why it is really difficult for them to say "ok my code is garbage". And when they hear that somebody is saying your code is not the best then they are really offended. This is a wrong approach from the beginning. The code is just the code and if you wrote it it is fine to just throw it away. It should not be a big deal.
You will write a lot of code in your next 3-5 or 10 years. Which actually means it doesn't make any sense to have some feelings about code at all. This is just some lines of letters. The best approach here is to show your code to other people, to discuss your code and understand what solution can be better.
Do your own projects
My next tip is also super important and I am saying it in every single video. You must implement your own projects if you want to become a better developer. It is not possible to do it otherwise. If you simply code on one job 8 hours every single day you will learn something. But you won't learn a lot because you have the same project, the same framework and the same language.
Which actually means at some point you can't really learn a lot of new stuff there, when you simply implement new features and fix bugs. You really must do some pet project in your free time. You can choose another language, another framework, you can try there new things. And actually it is not easy and it is not fast.
You must understand that it takes a lot of time and effort to implement a real project from the start to the end and deploy to production. But this experience will open for you new horizons. For example you can change job with another framework or language if you want to. Or you can just use patterns or ideas from another language that you learned. And if you just coded one more project in your free time this means that you become a better developer because you simply spend more time writing code.
Learn techniques and not tools
My tip number five is that you should learn techniques and not tools. And actually nowadays a lot of programmers are focused on specific tools. They really check every single new tool that they see in internet every single day. And especially in JavaScript world you are getting new frameworks, new libraries every single day.
You can't really stay in loop with them and you should not because actually they will never be mature and they won't be that popular.
This is why you need to return to the basics. You must learn the language that you are working with really really deep. You must know like 90% of this language. You must also master the framework with which you are working and the whole environment where you are working.
If we are talking about JavaScript or web development I highly recommend you to start with HTML, CSS JavaScript, add some framework, then go to Backend, Databases maybe even Devops stuff, so you understand the whole process of creating something from start to the end.
And I didn't say here that you need to learn some tools. You really can use some older tools or frameworks this is totally fine because you need to learn more techniques how to implement something and not just specific tool.
Additionally here I highly recommend you to look on design patterns of your language. This will help you to understand better the ways of structuring code and how to improve your own code.
And here is my bonus point which is super boring. You simply need to never stop learning and you simply need to code a lot. If you want to become a better developer you just need to code code code lots of hours. If you are coding 3-5 or 10 years and you are implementing different things you will for sure become a better developer.
Want to conquer your next JavaScript interview? Download my FREE PDF - Pass Your JS Interview with Confidence and start preparing for success today!