TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

AI commented the entire Spring Boot codebase

21 点作者 chuckhend大约 1 年前

16 条评论

ripjaygn大约 1 年前
These are exactly the kind of comments that you <i>don&#x27;t</i> want in your code base.<p>Comments should be about <i>why</i> the code is doing what it&#x27;s doing. By definition, this won&#x27;t be in the code, so the AI cannot divine it to existence.<p>Readable code is about <i>what</i> the code is doing, which should be apparent from reading the code. This AI tool can be used as a helper for a junior dev or to follow the call stack or code flow.<p>Maybe AI can do a good job one day when it has the full context of code, i.e requirements docs, transcripts of meetings, emails, JIRA tickets etc.
评论 #39519839 未加载
评论 #39519834 未加载
stevage大约 1 年前
There is an awful lot of this:<p><pre><code> &#x2F;\** \* Checks if a library is excluded. \* \* @param library the library to check \* @return true if the library is excluded, false otherwise \*&#x2F; protected boolean isLibraryExcluded(Library library) { return library.getName().equals(&quot;Spring Boot&quot;); } </code></pre> The comment adds nothing - I&#x27;m still confused what this one line function is meant to do or what the word &quot;excluded&quot; means in this context.<p>The thought definitely occurs that whatever comment value can be generated automatically could also (and perhaps should instead) be done locally for the viewer, rather than actually being stored in the codebase. Then it doesn&#x27;t clutter up the codebase, and also can&#x27;t get out of sync.<p>Or since these comments are really JSDoc style comments, they could be applied just before documentation is generated.
jes5199大约 1 年前
I like the idea, but there’s no reason to commit these back to the repo. In fact, you could just make a code-viewer that generated fresh explanations whenever you open the file<p>a lot of generative AI is like this. Oh, it made a beautiful picture, but why bother saving it, you can just generate a fresh one every time
评论 #39519795 未加载
评论 #39519767 未加载
pylua大约 1 年前
It looks like a lot of boiler plate that adds noise. Usually the most useful comments explain the function in its context, not the code itself. Or, if the code does something atypical then a comment is very useful.<p>This is interesting, but a waste .
SquareWheel大约 1 年前
I appreciate the professional exchange between contributor and maintainer. It was contributed with the expectation not that it would be merged, but that it could be adapted into a useful PR if the maintainers were interested. They weren&#x27;t, so they respectfully parted ways.<p>Skimming through some of the code comments, this tool actually does a pretty good (though not perfect) job of interpreting each function. It would likely need to be limited to only larger functions though, since many of the smaller or boilerplate functions are self-explanatory. And seeing as this is Java, there are a lot of those!
PaulKeeble大约 1 年前
I am not impressed. These comments don&#x27;t add much at all. There are some that superficially look OK and to add some knowledge but in practice are wrong. Then there is stuff like this that doesn&#x27;t need to be there.<p><pre><code> &#x2F;** * Returns the type of the artifact release. * @return the type of the artifact release *&#x2F; public String getType() { return this.type; } </code></pre> But then you also have the following which looks reasonably promising and does contain useful information that you would only get from the code or the docs.<p><pre><code> &#x2F;** * Constructs a new instance of AutoConfigurationMetadata. * * This method retrieves the inputs and sets the file path for the * AutoConfiguration.imports file located in the * META-INF&#x2F;spring&#x2F;org.springframework.boot.autoconfigure directory. The path * sensitivity is set to RELATIVE and the property name is set to * &quot;org.springframework.boot.autoconfigure.AutoConfiguration&quot;. * * The method also sets a dependency on the processResources task name of the source * set. * * Additionally, it creates a configuration named * &quot;AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME&quot; if it does * not already exist in the project&#x27;s configurations. *&#x2F; public AutoConfigurationMetadata() { getInputs() .file((Callable&lt;File&gt;) () -&gt; new File(this.sourceSet.getOutput().getResourcesDir(),</code></pre> @@ -68,19 +84,35 @@ public AutoConfigurationMetadata() { .maybeCreate(AutoConfigurationPlugin.AUTO_CONFIGURATION_METADATA_CONFIGURATION_NAME); }*
hmeh大约 1 年前
Given that the only comments worth having are typically those that explain why, and an AI would have a hell of a time knowing why code was the way it was, there&#x27;s very little chance that this does anything but add noise. It&#x27;s exactly the type of &quot;productivity enhancement&quot; we should expect from AI right now. That is, as long as you measure productivity by lines of code and nothing else that actually matters to the business.
threeseed大约 1 年前
Pretty funny.<p>Especially for Java which has always tended to be a verbose language that emphasises highly descriptive class and method names.<p>The idea is interesting but better done as an IDE plugin where I can hover over a method and have it show an auto-generated help popup. I suspect IntelliJ is already working on something like that.
splatzone大约 1 年前
Can someone familiar with the Spring Boot codebase confirm if these comments are useful or not?<p>At a glance - and I&#x27;m not a java developer - a handful of the comments seem to add some specific context that&#x27;s not obvious from the code alone: <a href="https:&#x2F;&#x2F;github.com&#x2F;spring-projects&#x2F;spring-boot&#x2F;pull&#x2F;39754&#x2F;commits&#x2F;d69317431c623f9b9be07771dba8e1d153b1e991#diff-06d556cdacae547b52a06e42d38030533e1cca0fc0b28c529f993be2d737ddaeR144">https:&#x2F;&#x2F;github.com&#x2F;spring-projects&#x2F;spring-boot&#x2F;pull&#x2F;39754&#x2F;co...</a>
评论 #39528315 未加载
hombre_fatal大约 1 年前
The AI comments seem to get pretty helpful in the best case scenario of complicated functions, but they also get too spammy in the worst case scenario where it&#x27;s adding &quot;Returns a value&quot; to `public getValue()`.<p>Whether you want every function in the codebase to have a comment is a rather deliberate style, not something you&#x27;d just merge in from an unsolicited PR.<p>But if the tool is automated and easy to use, seems like something useful for local development or a way to shop for good comments that are missing from the code.
chuckhend大约 1 年前
A very kind response by someone from the project team
评论 #39524102 未加载
davesque大约 1 年前
Seems spammy to drop a 100k line PR of just comments, AI generated or otherwise. No maintainer in their right mind would want to review that.
samrolken大约 1 年前
Comments are most helpful when they explain something that is <i>not</i> obvious by just looking at the code. Comments that just explain what the code plainly does don&#x27;t add much value. This kind of technology can still be useful in other forms as other comments here note, but this kind of auto-commenting, I really don&#x27;t see it catching on.
tenlp大约 1 年前
For a mature project, it is almost impossible to directly introduce AI and add comments to all codes.
xyst大约 1 年前
Blatant advertisement for their product. Shameful pull requests like this need to be deleted&#x2F;purged.<p>Look at this trash:<p>...<p>&#x2F;* * Makes all warnings fatal for the given project. * @param project the project for which to make warnings fatal <i>&#x2F; private void makeAllWarningsFatal(Project project) { project.getExtensions().getByType(AsciidoctorJExtension.class).fatalWarnings(&quot;.</i>&quot;); } ...<p>Quite possibly the most useless javadoc I have seen. Code itself is self documenting. It&#x27;s like when the developer gets paid per line of code, this is what is generated.
Jupe大约 1 年前
No, no, no! Tell me something useful about the code, or why it is there in the first place...<p>Tell me where it&#x27;s called from, how often it&#x27;s called, if the caller can ever send null args, expected execution time, who wrote it, and when, and what else changed when it was first created, whether it is executed under a unit test or functional test.<p>But please do not tell me what it is doing... That&#x27;s the one piece of information I don&#x27;t need since I&#x27;m already looking at the code.