Skip to main content

New answers tagged

5 votes

Are comments obsolete in favor of Generative AI?

The documentation of a function/method/class/interface should not be what it does, but its contract: what it commits to do, and what it doesn't commit to do, not how it does it. You have the source ...
jcaron's user avatar
  • 219
6 votes

Are comments obsolete in favor of Generative AI?

Comments should not explain what the code does. They should explain why the code exists. A.I. will never explain what the original coders intent was. We don’t need A.I. for this. We need coders who ...
candied_orange's user avatar
4 votes

Are comments obsolete in favor of Generative AI?

There are already plenty answers that address the core issue of whether an AI can generate a comment well enough without further supervision and whether the "reader-side" generation strategy ...
Frank Hopkins's user avatar
8 votes

Are comments obsolete in favor of Generative AI?

In many cases, the most useful comments are those which don't describe how something works, but those that describe what alternatives were considered, and whether they were found to be inferior or ...
supercat's user avatar
  • 8,583
53 votes

Are comments obsolete in favor of Generative AI?

Three things: If AI could sufficiently document code, it should be done once at the time the code is authored, not many times every time someone forgets what the code does. This is primarily an ...
svidgen's user avatar
  • 15.1k
5 votes

Are comments obsolete in favor of Generative AI?

Comments on method signatures have been "obsolete" for decades provided the method signature conveys enough information for the human to understand what the method does at a high level. This ...
Greg Burghardt's user avatar
26 votes

Are comments obsolete in favor of Generative AI?

That function is a great example of why not all functions need comments. Comments (and function docs) are to explain things that aren't immediately obvious. For example this (pretend) hand written ...
Richard Tingle's user avatar
1 vote

Are comments obsolete in favor of Generative AI?

It is not a bad idea, if your code is self-explanatory. Comments are a nice tool to express concepts that have meanings in a higher level of abstraction respect the one of source code. Pointless if ...
pber's user avatar
  • 11
2 votes

Are comments obsolete in favor of Generative AI?

Maybe, soon an AI will write your comments. And yet another AI will read the generated comments to digest it for someone else. I bet that if the generated comments are as fluffy as in your example, ...
Christophe's user avatar
  • 78.6k
8 votes

Are comments obsolete in favor of Generative AI?

I think the fundamental problem here is how many managers think of source code as an instruction manual on both the art of development and on how they do business. So if they have a piece of code, ...
Steve's user avatar
  • 9,202
5 votes

Are comments obsolete in favor of Generative AI?

Yes comments are obsolete. But not because of generative AI. Because you your function is just IsEven and that's enough. On the question of AI, we should note its not explaining the function. It's ...
Ewan's user avatar
  • 77.3k
105 votes

Are comments obsolete in favor of Generative AI?

"With generative AI, you can just ask it to explain the code to you" And it will explain to me what the code does. Which I already know, because I can see the code myself with my own eyes. ...
Moschops's user avatar
  • 691

Top 50 recent answers are included