Do You Ask AI to Add Comments When Coding?

0
10
Asked By CodeMaster27 On

Hey everyone! Quick question for you all — when you're using AI coding tools like Cursor or Claude, do you ever request them to generate comments or docstrings in your code? I've been working with anti-gravity syntax and Claude for refactoring or creating new functions, but I usually focus just on the code itself. As our projects grow larger, I'm starting to think that explicitly asking the AI to add useful comments might benefit both the AI and anyone else who reads the code later on.

2 Answers

Answered By DevDebater23 On

In my experience, many comments in codebases are not that helpful, and AI-generated ones can be just as bad, if not worse. I think useful comments are rare; they should explain why the code is doing something unusual or reference important external resources. On the flip side, comments that merely state the obvious or repeat what the code does can be a hassle, especially since code changes but comments often don't get updated properly.

TechieTina87 -

I get what you're saying! But I sometimes find even short comments useful for organizing large chunks of code. Just a word or two can really help with navigation without needing to break everything into smaller methods.

Answered By CuriousCoder42 On

I generally don't ask for comments because I try to keep my prompts concise, aiming to avoid unnecessary verbosity. AI-generated comments often just repeat what the function's name says or provide way too much information that's beyond what's needed – it's frustrating! I feel like we're drowning in generated documentation that's hard to sift through, and often it's misleading or incorrect.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.