3 ms·
These are exactly the kind of comments that you don't want in your code base. Comments should be about why the code is doing what it's doing. By definition, th
by ripjaygn 3y ago
These are exactly the kind of comments that you don't want in your code base.
Comments should be about why the code is doing what it's doing. By definition, this won't be in the code, so the AI cannot divine it to existence.
Readable code is about what 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.
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.
- stevage 3y ago>By definition, this won't be in the code, so the AI cannot divine it to existence. I don't think that's true. You're essentially saying that no one other than the original author can possibly add useful comments, and that is manifestly untrue. It's well within the reach of AI to add comments about how a function is used, and even infer things like "detects errors that might cause an exception to be thrown later".
- ripjaygn 3y agoThe AI is adding comments like these: private void makeAllWarningsFatal(Project project) { /** * Makes all warnings fatal for the given project. * * @param project the project for which to make warnings fatal */ What does this achieve? The code already has readable function names. It just creates clutter and makes things worse by forcing people to scroll more by making less code fit in a window. What would be useful is commenting why a setting to make all warnings fatal is a use case. For example, a comment stating that this is used to improve code quality and reduce risk by forcing the developer to fix all warnings which could be hiding errors. This AI is utterly useless at coming up with that.
- Freedom2 3y agoPlaying devil's (GPT's?) advocate here - they can be somewhat useful for autogenerated documentation where you don't have access to the code and only some form of browser or other text documentation. Otherwise I agree with you.
- stevage 3y agoYeah I think there is potentially value in generating comments at the time of generating documentation - but not actually storing them in the code.
- tivert 3y ago> What does this achieve? State-of-the-art digital solutions to liberate humanity from the tyranny of work.
- stevage 3y agoI'm not sure how you read my comment as somehow defending the current implementation or the comments it has generated so far.
- pylua 3y agoI agree completely. The problem here is that ai can’t run the code 1000s of times to deduce the context to create more meaningful comments. Maybe this is what will save humans against the robots — the ability to verify and study topics in their context efficiently.