DEV Community

Discussion on: How does flimsy code affect your mental health?

Collapse
 
grahamthedev profile image
GrahamTheDev • Edited

My mental health doesn’t suffer…but I certainly go through keyboards a lot quicker with my “angry typing” when confronted by a horrendous codebase!

Being serious, well organised, structured and COMMENTED code is a lot less stressful to work with and you can get a lot more done. I have been spending a lot more time tidying code as I go rather than “I will fix it later” as it saves me a lot of frustration when I come back to it 6 months later and try to understand what young me was thinking at the time!

So for the sake of your own health, and that of your team, take 5 minutes to clean up your code before committing it and, as I said, comment parts that need it (don’t believe the “good code doesn’t need comments” crap, even the cleanest code is easier to navigate if you explain more complex functions!

Collapse
 
renanfranca profile image
Renan Franca

Hello my friend @inhuofficial ,

I am trying hard to not comment on my code because I believe if I named the variables, the methods and the classes right, everyone will understand it.

But this article (rubenscheedler.hashnode.dev/the-mo...) changed my mind about using my comment to give context to the future devs that will maintain the code. I am going to comment when I can't fix a technical debt or when I create technical debt.

Collapse
 
mephi profile image
mephi

My angry typing got me a tendinitis. Would not recommend it.