I’m a new joiner at the company and working on my first project. Understanding the data structures and the business side seemed overwhelming.
I try my best, but I must call the manager for help.
“This code looks awesome.” - the first comment they said.
First impression matters even in coding
I didn’t do anything special. My code barely worked, and I just threw everything into a code formatter.
Good looking bad code > bad code.
100 times.
We know how important the first impression is. Why would that be different with code?
The first impression of my code was a first impression of my working style. With good-looking code, you can build trust. It’s not only about technical skills, it is a form of professional communication. It will show your attention to detail and respect for collaborative work.
If you work in an environment where most code looks like a pile of garbage, you can easily stand out by spending 10 minutes on making your code pretty. It’s not that hard at all.
Properly formatting code is an easy way to stand out!
Other benefits:
When your code is well formatted and commented, it is easier to read through, understand, and work with.
The manager was happy to help because they immediately realized that it was NOT going to be a struggle. If you have a bad-looking code the first comment you will get is “Ohh my god… ok let’s take a look” (With a sad tone). And they will start the exercise with a bad first impression. You will spend more time figuring out what is happening than actually working on the code.
As newcomers, we inherit a lot of code, and we all know how painful it is to figure out bad-looking code. We should remember this when we leave code behind. Good formatting practices reduce onboarding time for new team members.
It’s not just for others. Even if you write the code, you will not remember why you have written stuff the way you did. Save some pain in the neck for everyone!
Look at the examples below:
It takes only 10 minutes
I know when you are in the zone, you don’t really spend time on formatting the code. You only care about the results, it is working so let’s go on to the next step.
Wrong approach. No matter how senior you are, ugly code will be poison for everybody.
If you are working on a block of code for 1 hour, then spending 1/10 of that time to format and comment is not that much. And it will pay dividends for the reasons above.
Use ChatGPT. It will take not 1/10 but 1/20 of the time. It can easily format and comment your code, you don’t even need crazy prompts.
Please format and comment the below code for me:
That’s it.
To conclude
Use extensions in your code editor. Most code editors offer different extensions for code formatting. With a click of a button, you can make your code standardized and pretty.
Use online tools: There are awesome free websites where you can copy in your garbage code and with a press of a button you get a good-looking block. Just Google code formatter for your programming language.