HACKER Q&A
📣 damacaner

What do you think about documenting code with GPT?


I literally don't know what is the convention for this.

Is it a bad thing to write everything about function, then dump the function / functions that the documented function calls to ChatGPT, and let it handle the documentation? It saves a lot of time documenting, but I feel like it is a bit verbose, and it never thinks like "hmm people reading this will know how to code" and goes into every smallest detail possible. Which is... kinda good?

But I don't know. Our codebase is literally filled with GPT generated comments all over the place

"this function does..."

same structure everywhere. and I started to think "are we doing a good thing?". I sometimes don't even read the generated doc because it is way overly verbose, but at the same time, it feels good to not worry about it,dump function, paste docstring, done.

What do you all think about this?


  👤 Bostonian Accepted Answer ✓
I agree that GPT docstrings are verbose, but I think it is faster to let GPT write docstrings and trim them manually than to write them from scratch.