DEV Community

Discussion on: 6 ways minimalism can help you write clean code

Collapse
 
codemouse92 profile image
Jason C. McDonald • Edited

Excellent tips! I follow these myself.

My only addition...

Commented code is just noise: It's not useful to the software, it's distracting to the people reading your code, and it's just not pretty. Get rid of it!

I'd apply that only to comments describing what the code is and how it does it. Commenting intent ("why") has proven to be a massive time-saver for both myself and anyone else reading or working on my code. More about that here.

With that said, what you described with commenting is otherwise spot-on.

Collapse
 
paulasantamaria profile image
Paula Santamaría

Couldn't agree more. Comments explaining the purpose of the code are totally ok, as long as they provide value (which I believe they do). I even wrote an article about writing comments to document your JS code using JSDoc.

Thanks for your comment, Jason! 🙏