DEV Community

Aashita31
Aashita31

Posted on • Edited on

Let your code talk..!

Hi there,

Hope you all are doing good..!!

So here is something that I would like to share. I came across the most basic thing i.e 'The importance of Comments in our code'.
I am creating a sync drive custom logical implementation with laravel and vuejs. When it all started my thought was that once the connection part is successful it will be the easy road to the end.
Nope here is the unexpected turn, The folder structure includes multiple dynamic folders and sub-folders creations with multiple security data checkpoints then comes the upload part with the right dynamically selected folder.
It started with 4-6-8 and so on conditions, from if to foreach to if-else to else-else-else...
It was getting complicated after every condition, every checkpoint addition it was tough to keep track of all previous ones if about code is not mentioned. To keep track I started placing one-liners /* */ tho, algo was helping but the code complexity was a major throwback. At this point, the comments helped me not only to keep track of my previous checkpoints but with optimization as well.

We have a practice writing about our code above func and class. I never realized that comments play such an important role till today. It not only helped me know my code better but even my friend got a friendly connection with my code. I don't have to be the middleware between them everything was easy and understandable which was the best part.

Ya, it's gonna help me later as you know na computer memory storage is more than us human.

So guys, Let your code talk it's much more effective..!

Cya another time:)

Top comments (2)

Collapse
 
camelcaseguy profile image
Shubhendra Singh Chauhan

That's right @aashita31 - comments play an important role in making code more readable and improving code quality. 👍

Collapse
 
aashita31 profile image
Aashita31

Yes @withshubh , It definitely improves code quality as well as makes it a lot friendly. Especially complex codes.