My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more
programming
programming
#programming-cikxvrcrl00bwh453cmkktotz
14 articles
Sahil
Discuss

·

27 likes

·

601 reads

Mark
Write comments: I definitely changed my mantra from Real Programmers do not comment their code to A quick description won't hurt. I think that's overcompensating a bit. Having redundant descriptions is useless, and having wrong/outdated descriptions is worse than useless, so technically it can hurt. You mention someone asking you what the code does. That's a clue that it is not clear enough without comments. But this is clear enough without the comment, in my opinion: // @route: Gets all profiles route.get("/profiles", (req, res, next) => { // ... } That said, I like the post and it has good lessons! Use good names, document apis, don't skip comments alltogether. But just use your judgement on when comments are needed. Don't be extreme in either direction. Try simple code and good names first, and then if it's still unclear, add comments. (As a hint, anything that starts with "real programmers ..." can de safely disregarded as advice).
6

You've reached the end! 👋