DEV Community

Cover image for JSCD: You Can Never Have Too-Clean Code
Arit Developer
Arit Developer

Posted on • Edited on

JSCD: You Can Never Have Too-Clean Code

This week at my new job, I was tasked with creating a new feature for one of our web apps. Specifically, I had to "expose" some information from our database to the web app, not for immediate use, but in case this data was necessary down the line.

My task required me to dive deeeeeeep 🌊 into our codebase. There were so many methods, variable definitions, modules and models to investigate and step over - all to decide if the data I sought to uncover had already been queried elsewhere in our app. That's when the absolute importance of clean, well-written code hit me. 🧱

As a bootcamper, I remember how often I heard "Name your variables, methods and functions intelligently". I admit, this is advice I didn't take seriously at first. After all, who else is reading the code for my kick-ass personal project? As long as I understand it right? However, in my opinion, that is one of the weaknesses of solo projects - we don't get to build those coding skills that enhance and promote collaboration. This is the main reason why, before landing my current job, I decided to get into opensource (starting with Dev.To - yay! 🎉). I needed to learn how to read and understand other people's code, and get comfortable with coding with others.

Typically, large professional codebases require significant energy to understand the various constructs, data types and paradigms that are being implemented. Clean code ensures that the newbie developer isn't further burdened with figuring out what a variable refers to. 🤔 Clean code really makes software development easier.


PS This journal entry doesn't delve into what constitutes clean code. I do understand that "clean code" can be defined subjectively.

Top comments (5)

Collapse
 
qm3ster profile image
Mihail Malo

I see this post is part of a series.
Have you considered using the DEV.to series feature?
Here's how:

Collapse
 
aritdeveloper profile image
Arit Developer

Thank you Mihail! I didn't know about this!

Collapse
 
qm3ster profile image
Mihail Malo

finger guns emoji

Collapse
 
theodesp profile image
Theofanis Despoudis

It's not only that, you also try to keep the same style of the codebase for consistency. That alone will take some time to accomplish.

Collapse
 
qm3ster profile image
Mihail Malo

I want to eat that soap