Live data from Hacker News

AI PR adds auto generated comments to whole Spring Boot Project

github.com

21–30 of 48 posts

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

#21
post #11

Earlier quoted context omitted.

Reminds me of something I learned of over a decade ago: isUserAMonkey Added in API level 8 public static boolean isUserAMonkey () Returns "true" if the user interface is currently being messed with by a monkey. - https://developer.android.com/reference/android/app/Activity...

I wonder why this exists. What is this code for. How would they even know its a monkey?! I'm sure its a joke of sorts, or clever moniker if you want to be charitable, but unclear to me in any case

https://developer.android.com/studio/test/other-testing-tool...

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

#22
post #11

Earlier quoted context omitted.

Reminds me of something I learned of over a decade ago: isUserAMonkey Added in API level 8 public static boolean isUserAMonkey () Returns "true" if the user interface is currently being messed with by a monkey. - https://developer.android.com/reference/android/app/Activity...

I wonder why this exists. What is this code for. How would they even know its a monkey?! I'm sure its a joke of sorts, or clever moniker if you want to be charitable, but unclear to me in any case

[deleted]

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

#23
post #11

Earlier quoted context omitted.

Reminds me of something I learned of over a decade ago: isUserAMonkey Added in API level 8 public static boolean isUserAMonkey () Returns "true" if the user interface is currently being messed with by a monkey. - https://developer.android.com/reference/android/app/Activity...

I wonder why this exists. What is this code for. How would they even know its a monkey?! I'm sure its a joke of sorts, or clever moniker if you want to be charitable, but unclear to me in any case

[deleted]

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

#24
Comments that say HOW commonly useless, as that is almost always self-evident (i.e. "just read the code."). Comments that explain WHY are worth their weight in gold, and not something AI could ever create.

For example:

    // How: This filters records by MyType of J and if they have children   
    // Why: We want Jobs (J) when those Jobs have Children. Otherwise, we'll get JobGroups or Jobs without any Children we need to process below.   
     .Where(T => T.MyType == "J" && T.Child.Count() > 0);  
WHY are, by their very nature, business rules or explaining a thought process. If the original developer of the code moves on or is unavailable, that information can sometimes not be found elsewhere.

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

#26

Comments that say HOW commonly useless, as that is almost always self-evident (i.e. "just read the code."). Comments that explain WHY are worth their weight in gold, and not something AI could ever create. For example: // How: This filters records by MyType of J and if they have children // Why: We want Jobs (J) when those Jobs have Children. Otherwise, we'll get JobGroups or Jobs without any Children we need to proc…

>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.

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

#27
Ironically, it would've been more useful, and more inline with how non-trivial advancements in AI have been, to identify useless and obvious comments, and eliminate them.

I just experimented a little bit, and telling chatgpt to assume a self-documenting approach and skipping comments whenever possible, gets a pretty minimalist output. Add on asking about what non-obvious aspects might be noteworthy based on other projects, and I bet chatgpt would be able to find a list of things to look for, see if it's applicable, and then rewrite in the appropriate format. Like if the function is about sorting, it could figure out that knowing if it's stable is an important marker, and figure that out. Something like that could be useful.

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

#28

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 like a useful comment, and more like a joke trying to highlight the absurdity of aiming for complete javadoc coverage.

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

#29
post #26

Comments that say HOW commonly useless, as that is almost always self-evident (i.e. "just read the code."). Comments that explain WHY are worth their weight in gold, and not something AI could ever create. For example: // How: This filters records by MyType of J and if they have children // Why: We want Jobs (J) when those Jobs have Children. Otherwise, we'll get JobGroups or Jobs without any Children we need to proc…

>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.

> Really? You don't think it's a matter of updating the prompt and expanding the context to include more of the code?

AI isn't magic. If the "why" isn't in the code, there's no way for it to magically synthesize it.

Comments explaining "there's a check for this edge case because we saw a problem in production when client X did something, see JIRA-1234 for more details" are what you should be aspiring to. If a human doesn't write that down, the AI can't invent it.

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

#30
post #26

Comments that say HOW commonly useless, as that is almost always self-evident (i.e. "just read the code."). Comments that explain WHY are worth their weight in gold, and not something AI could ever create. For example: // How: This filters records by MyType of J and if they have children // Why: We want Jobs (J) when those Jobs have Children. Otherwise, we'll get JobGroups or Jobs without any Children we need to proc…

>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.

Because the information leading to the comment is not necessarily in the code itself? E.g ‘we did this because of business constraint xyz’
Post reply on HN