Best practices for writing code comments

While there are many resources to help programmers write better code—such as books and static analyzers—there are few for writing better comments. While it's easy to measure the quantity of comments in a program, it's hard to measure the quality, and the two are not necessarily correlated. A bad comment is worse than no comment at all. Here are some rules to help you achieve a happy medium. The post Best practices for writing code comments appeared first on Stack Overflow Blog.

https://stackoverflow.blog/2021/07/05/best-practices-for-writing-code-comments/

Created 4y | Jul 5, 2021, 3:21:36 PM


Login to add comment

Other posts in this group

“We’re not replacing you; we’re with you”: Where AI meets infrastructure

Ryan talks with Greg Fallon, CEO of Geminus, about the intersection of AI and physical infrastructure, the evolution of simulation technology, the role of synthetic data in machine learning, and the i

Apr 29, 2025, 4:50:03 AM | StackOverflow blog
How self-supervised language revolutionized natural language processing and gen AI

Self-supervised learning is a key advancement that revolutionized natural language processing and generative AI. Here’s how it works and two examples of how it is used to train language models. https:

Apr 28, 2025, 2:50:12 PM | StackOverflow blog
Banking on innovation: Engineering excellence in regulated financial services

Financial institutions face a balancing act between tech innovation and strict regulations. As customer expectations for improved user experience and demands from those tasked with enhancing features

Apr 28, 2025, 2:50:11 PM | StackOverflow blog
Grab bag! On the floor at HumanX

Today’s episode is a roundup of spontaneous, on-the-ground conversations from HumanX 2025, featuring guests from CodeConductor, DDN, Cloudflare, and Galileo. https://stackoverflow.blog/2025/04/25/grab

Apr 25, 2025, 5:50:06 AM | StackOverflow blog
Standardization and simplification as key to engineering excellence

In this episode of Leaders of Code, we chat with guests from Lloyds Banking Group about their focus on engineering excellence and the need for organizations to adapt to new technologies while ensuring

Apr 24, 2025, 1:40:03 PM | StackOverflow blog
Visually orchestrating data diagnostics but platform agnostic

Ryan chats with Dataiku CEO and cofounder Florian Douetteau about the complexities of the genAI data stack and how his company is orchestrating it. https://stackoverflow.blog/2025/04/22/visually-orch

Apr 22, 2025, 5:50:08 AM | StackOverflow blog