Writing Clean Code

Pranav Tiwari
2 min readDec 12, 2024

--

Day 347 / 366

One of the hardest things for me to grasp as a self-taught programmer was the importance of writing clean code. This is something that they don’t teach you in college, and even if they do, it is taught in a theoretical way. But it’s only after you have worked with bad code that you realise the true importance of the good version.

When I started out writing code, I wrote it horribly. Thankfully I did not use GitHub back in the day, and no one can see what a horror some of my initial projects were. The good thing was that I kept at it, and so I slowly but surely got better at it.

It took me 3 years to become good enough to distinguish clean code from not-so-clean one. But what I am really proud of is that I have been able to teach this to others much more quickly. From the first day that any intern joins my team, I emphasise the significance of following good coding practices. The effect has been that within months when they see code from any external projects, they are able to point out why it's bad. To me, this is a huge win.

At the office today we came up with coding guidelines to follow while working on our projects. Things such as “What should be the maximum number of lines a file can be?” or “We should have only one React component per file”. Many would find these things a waste of time, but I am betting that these are what make or break large projects.

--

--

Pranav Tiwari
Pranav Tiwari

Written by Pranav Tiwari

I write about life, happiness, work, mental health, and anything else that’s bothering me

No responses yet