Good Developer: The Secret Is In The Details
3 min read
Photo by Shane Aldendorff on Unsplash
I wrote my first line of HTML back in 2009 after generating a website with Web Acapella. I learned the basics of setting up a host and using FTP (File Transfer Protocol) to essentially deploy the website and add any updates I had for it.
It was a basic website where I could download software that I had to redownload many times, mainly drivers (now in retrospection, wasn’t a good idea) but also savegames.
Today, I consider myself a decent programmer, I care deeply about the code and even used to be attached to the code. That was until a good friend of mine and an awesome developer Samar Vir said:
“No one cares about the code you write until they have to read it.”
At first to his unknowingness, I took it quite harshly and felt quite hurt as I admired him and respected him but for some reason, it stuck with me and that is probably one of the best pieces of advice I have ever received in life, as it can be applied everywhere.
I have since then deviated slightly from that perspective, and I continued to care about the code I wrote. However, I’m no longer attached to a string of bytes on a document, no that’s not what I care about.
I don’t care about what other developers will think about my code when they’re reading it, but how their minds interpret it.
To be more specific I care about the little details, and I want through those little details to share my thought process and consequentially highlight the pattern that my code is conveying. I want the reviewer to get into the same mindset as me with as little effort possible because that at the end of the day will be more appreciated than by how much you unnecessarily optimized a piece of code.
Technically speaking it can be hard to convey the aforementioned habits in just code and sometimes we feel like an extra explanation could be used and highlighting/commenting those specific lines after opening a PR goes a long way.
Writing good code is hard but writing approachable code is even harder.
My advice is to remember that we all share different thought processes but most of us are smart enough to leave that box and follow different patterns.
So next time you write code, make it a priority to ease the future reader into your mind because once they’re following the rivers of your neurons they will just flow with it
I’m lucky to be surrounded by a team of amazing developers whose code is almost poetic and the best way to teach someone is to get them excited and if the code you write excites the other developer then not much needs to be done.
One last but important piece of advice and something I need to make into a habit more and more is to review your code before requesting a review.
You can do it without before even leaving VSCode by using the GitLens extension.
For those reading until the very end, thank you a lot and I hope the article was somewhat helpful.
Have a nice day and don’t forget to drink water!