How to become a better coder
Would you like to improve your coding skills? From working more efficiently to learning from past mistakes, Computer Science student Kyle shares eight ideas to help you progress.
I would like to preface this blog by saying that I am not a professional coder, nor have I coded anything on that level at the time of writing. This blog doesn’t aim to improve on a particular language, library, or any technical aspect of coding, but rather, it aims to improve your productivity as a coder. ‘Nuff said…. now on to being a better coder!
1. Have a “dev” journal. Write about the things you found challenging and how you overcame them. Recruiters like hearing about your thought process so not only does documenting it get you in the habit of showing how you overcame obstacles, but it also leaves you with the solution, so if you get stuck on something similar you’ve already got the answer!
2. Compartmentalise. Find a way to break down what you need to do into sub tasks. Tackling smaller, more manageable tasks is much easier than developing as you go. It gives you distinct goals to reach, helps avoid “feature creep” (when you make your program more complicated than it needs to be), and lets you “go gold” (as they say in the gaming industry). You end up building exactly what you planned to build - no less, no more.
3. Eat the frog first. Having compartmentalised, find the task that you believe will be the hardest and do that first. This way all the tasks that follow are literally easier and you would most likely tackle them faster and more efficiently. Eating the frog first also helps you cross a mental barrier: if you can code what you deemed to be the hardest, then you can definitely code the rest of your program.
4. Use Flow State. Flow state is a mental state in which you are totally immersed in a task and able to give it your full attention. It is important to find your Flow State, but also to understand that it comes in waves. When things aren’t quite clicking, there’s nothing wrong with taking a break and stepping away from coding for a while to recharge. Figuring out what helps you enter Flow State is also vital: maybe it’s routine, maybe it's intrigue, but whatever it is, try to find it out and implement it.
5. Code outside of your studies. Code completely irrelevant things that do not relate to your studies or work. Code as a hobby! For the most part, this forces you to learn how to code something without a “guiding hand” and helps you become more confident in your coding abilities. You will also improve your coding knowledge base by using languages, libraries, tools or technologies that you wouldn’t have used otherwise.
6. Code it simple first. You don’t need to make your code extremely efficient the first time round. Get it to work, figure out why it works, and then refactor it to be more efficient. When you learn a new technique, it’s normal to want to use it immediately, but that doesn’t necessarily mean you’re ready to use them in your coding. Make it work the way you know how to first, and then see if you can improve on the code with the techniques you learnt later.
7. Keep all your old programmes. Over time, you’ll get much better at coding. Reflecting on your old code and seeing where you could improve it is useful. Not only are you seeing the things you once found challenging, but you’re reading code and trying to understand why it works. This is an essential skill you’d need when you work on a team, therefore an essential skill to learn as a coder. After reading your old code, why not try to code a better version from one of your old projects?
8. View the glass as half full, not half empty. You’re stuck and you don’t know what the solution is… yet. You don’t understand this particular library or language… yet. You don’t know how to improve… yet. Understand your limitations but know that if you work on them and learn from them they won’t limit you for much longer.
No one will ever reach peak coding skills, meaning you will always be trying to get better at coding. You shouldn’t want to improve to be the best, you should want to improve to be better. There is no one out there that is “the best”, but you can always get better and you should always try to be better!
“Perfection is achieved not when there is nothing more to add, but rather when there is nothing more to take away.” – Antoine de Saint, Exupéry.
Kyle studies Computer Science in the UK.