Live data from Hacker News

AI PR adds auto generated comments to whole Spring Boot Project

github.com

41–48 of 48 posts

Re: AI PR adds auto generated comments to whole Spring Boot Project

#41
post #26

Earlier quoted context omitted.

>and not something AI could ever create. Really? You don't think it's a matter of updating the prompt and expanding the context to include more of the code? I don't know the exact method of how they generated these comments, but I think just focusing a prompt on a single method with the entire codebase in context would yield much better results.

90% of the comments in the codebase on the project I work on now are links to JIRA tickets and incident reports. AI can't and won't ever do that, and those comments are absolute gold. You can immediately read a seemingly less than optimal or overly defensive snippet of code, wonder "what moron wrote this!?" and then immediately read the referenced ticket and realize that it's "overly defensive" due to a caller that a…

You don't think it's possible to integrate an AI system with JIRA so that it can link to the relevant tickets?

Re: AI PR adds auto generated comments to whole Spring Boot Project

#42

To be honest, I see two positives regarding what Codemaker has provided here. One is that (glancing through the comments) they're actually significantly more thorough than what is already there and they're at the level of thoroughness that a new user may actually want. Phil Webb is quite right; this is the level of detail someone new to the codebase could use, and if you could generate it dynamically on the fly as a…

> One is that (glancing through the comments) they're actually significantly more thorough than what is already there and they're at the level of thoroughness that a new user may actually want. Consider this real example from the pull request: /** * Returns the plugin version property. * @return the plugin version property */ @Input public Property getPluginVersion() { return this.pluginVersion; To me this seems less…

I agree on that example.

But contrast with this example: https://github.com/spring-projects/spring-boot/pull/39754/fi...

A function named `apply` with no documentation; you have to go up to the class to find the docs. And yes, it's not DRY to repeat the docs, but the fact the tool can pull relevant context into this location is helpful if it could be used as an on-the-fly doc generator (assuming, of course, it gives true output).

People (understandably) don't want to repeat themselves but they also can't predict what entrypoint a reader enters their class from. I've definitely bounced off APIs before because something like `apply` isn't doc'd even though it's doc'd in source twenty lines away (because I'm busy; I'm not scanning entire source files on the off chance that the thing I'm looking for is nearby).

Re: AI PR adds auto generated comments to whole Spring Boot Project

#43
post #31

To be honest, I see two positives regarding what Codemaker has provided here. One is that (glancing through the comments) they're actually significantly more thorough than what is already there and they're at the level of thoroughness that a new user may actually want. Phil Webb is quite right; this is the level of detail someone new to the codebase could use, and if you could generate it dynamically on the fly as a…

Do you have an example of those comments you think would be helpful for beginners? The second point doesn't seem like a positive on the whole, except maybe for the company selling it, in the "there's good money to be made in being part of the problem" sense. Edit: I noticed one comment that seemed like it added some useful context: For CheckAdditionalSpringConfigurationMetadata.Report::iterator it says "Each line rep…

> The second point doesn't seem like a positive on the whole, except maybe for the company selling it, in the "there's good money to be made in being part of the problem" sense.

No argument there (I don't miss those firm's doc standards). But you can make a lot of money being part of the problem in the business universe.

> The comment gives the appearance of being helpful while actually just adding confusion and wasting everyone's time.

That's definitely a concern; if the tool doesn't work it doesn't work, potential or no.

I think the first comment (https://github.com/spring-projects/spring-boot/pull/39754/fi...) looks helpful, although it is repeating info you can find in the class docs, the fact you have to go to the class docs to find it is an issue. A tool that could on--the-fly generate "Give me context for this function" (and give the right output) would be pretty useful for comprehending a codebase.

Re: AI PR adds auto generated comments to whole Spring Boot Project

#44

Earlier quoted context omitted.

90% of the comments in the codebase on the project I work on now are links to JIRA tickets and incident reports. AI can't and won't ever do that, and those comments are absolute gold. You can immediately read a seemingly less than optimal or overly defensive snippet of code, wonder "what moron wrote this!?" and then immediately read the referenced ticket and realize that it's "overly defensive" due to a caller that a…

You don't think it's possible to integrate an AI system with JIRA so that it can link to the relevant tickets?

There are probably already IDE integrations so you can make Jira-like strings clickable to the appropriate task, or show a tooltip to hover.

It doesn't even need fucking AI, just regexp and just a configuration, e.g. if your Jira project is called NAI, any word that has the format NAI-[0-9]* should be such a link to https://jira.lookatmenotusingfancyai.com/task/NAI-xx

Edit: then again, Jira tasks can end up being a place for long discussions. If the AI can summarize the end-result/the decisions taken, it would be useful.. but also as a Jira plugin.

Re: AI PR adds auto generated comments to whole Spring Boot Project

#45
post #32
post #26

Earlier quoted context omitted.

>and not something AI could ever create. Really? You don't think it's a matter of updating the prompt and expanding the context to include more of the code? I don't know the exact method of how they generated these comments, but I think just focusing a prompt on a single method with the entire codebase in context would yield much better results.

"Why" comments typically refer to things outside of the actual code, such as: * Past incidents * Regulations * What the code used to do, and why that was bad The whole point of a really good comment is that you can't infer it just by looking at the code. That's why it's there at all!

This should IMHO summarized in the related git commits.

Yes they become paragraph long. But that's the point. That's where I search for "why". And not just "why", "when, why and with what reasoning?".

Imagine if there were some interference that could derive a comment based on history and current code!

Re: AI PR adds auto generated comments to whole Spring Boot Project

#46
post #31

Earlier quoted context omitted.

Do you have an example of those comments you think would be helpful for beginners? The second point doesn't seem like a positive on the whole, except maybe for the company selling it, in the "there's good money to be made in being part of the problem" sense. Edit: I noticed one comment that seemed like it added some useful context: For CheckAdditionalSpringConfigurationMetadata.Report::iterator it says "Each line rep…

> The second point doesn't seem like a positive on the whole, except maybe for the company selling it, in the "there's good money to be made in being part of the problem" sense. No argument there (I don't miss those firm's doc standards). But you can make a lot of money being part of the problem in the business universe. > The comment gives the appearance of being helpful while actually just adding confusion and wast…

I don't know about that one. As you say, it's just repeating the class documentation, so maybe the tooling should make it easier to view the class docs if that's the problem. The generated version is also less clear: In what sense are the conventions "necessary"? The process "includes" the steps listed, but does it also include other things?

Re: AI PR adds auto generated comments to whole Spring Boot Project

#47

Earlier quoted context omitted.

> One is that (glancing through the comments) they're actually significantly more thorough than what is already there and they're at the level of thoroughness that a new user may actually want. Consider this real example from the pull request: /** * Returns the plugin version property. * @return the plugin version property */ @Input public Property getPluginVersion() { return this.pluginVersion; To me this seems less…

I agree on that example. But contrast with this example: https://github.com/spring-projects/spring-boot/pull/39754/fi... A function named `apply` with no documentation; you have to go up to the class to find the docs. And yes, it's not DRY to repeat the docs, but the fact the tool can pull relevant context into this location is helpful if it could be used as an on-the-fly doc generator (assuming, of course, it gives…

Unfortunately, your brain will have been trained to ignore all comments by the 100 other completely useless comments that do nothing but add noise.

If the tool generated that one comment without generating any useless comments, then it might be worth using.

Re: AI PR adds auto generated comments to whole Spring Boot Project

#48
post #45
post #32

Earlier quoted context omitted.

"Why" comments typically refer to things outside of the actual code, such as: * Past incidents * Regulations * What the code used to do, and why that was bad The whole point of a really good comment is that you can't infer it just by looking at the code. That's why it's there at all!

This should IMHO summarized in the related git commits. Yes they become paragraph long. But that's the point. That's where I search for "why". And not just "why", "when, why and with what reasoning?". Imagine if there were some interference that could derive a comment based on history and current code!

Commit messages aren't a great place for this, much of the time, because then you have to do archaeology just to figure out why something is the way it is.

I'm certainly a fan of including lots of detail in commit messages, but often I do so and then realize "hey, this particular information would be better situated close to the code", and I move it.

Other times, yes, it's really just best to leave in the commit message because no one looking at the after-version of the code will care. For example, removal of a deprecated feature.

Post reply on HN