Hello guys, I am back after a long break. I think this actually is the first article that you guys might be seeing in the coding section of my website.
Let’s get into today’s article. Today I am going to tell you guys about simple tips to become a better coder.
No Ctrl + C and Ctrl + V
I myself is a victim of this. Usually when we are working under tight deadlines, we are tempted to just copy and paste a part of code from some website and finish the work faster. But this process can be counter-productive, especially if you are new to the field just like me.
If you don’t completely understand the code, just google the code line by line and try to understand what each line of code really do. Otherwise if you are asked to replicate a function you did in some other project, I guarantee that you won’t be able to do that without referring to the earlier code.
So, what I recommend is that never write a line of code if you don’t understand what it does. Just go and google. I would take 1-2 minutes max and if you are likely to forget it, you could always write it down in your notebook. But believe me it would be super useful to you in the future.
Stack Overflow should be your last option, not the first one
You should never refer to stack overflow, when you come up with a problem. Always refer the documentations of the language you are using first. Always try to be familiar with the documentations. It is going to be your best friend going forward. This is the only way you are going to learn something properly.
Every programmer has his own unique coding style. If you refer to Stack Overflow more often, you are not going to develop your own coding style. Documentations give you the basic knowledge you need. Then you can go build the logic in your own terms.
I am not saying that you should stay away from Stack Overflow. I am just saying it should not be your first option.
Learn from your mistakes
When you refer to documentations and try to build your logic in your own code, you are going to come up with errors. That is normal. You might not be able to fix it even by debugging. You might have to go to Stack Overflow and you may find what is wrong with your code there.
So, this moment is crucial brother. You again should never copy and paste the code. Don’t do it even if you understand the whole thing. Write down what went wrong in your notebook and how you fixed it. This way you are more likely to remember how to get over that particular error if you ever come across it someday.
Use the Feynman technique
- Pick a part of your code or maybe a coding concept
- Research about that topic and write down everything you find out in your notebook
- Try to explain that part of code or the topic in simpler terms to someone else
- Repeat the process until you don’t need to refer to your notebook at all
If you can explain a coding concept or a part of code to someone else, you can say that you understand the code. If you can’t, you just don’t understand the concept properly yet. In that case, you should keep learning about this concept
That is it for today guys. Thanks for reading my article. If you found it useful, subscribe to my blog and share the article among your “coder” friends. Hope to see you guys soon.