Would take a few seconds to clean up or add comments anyway with Claude if it didn’t do it already automatically
// Don't do this if there's more than 1
if (foo.length <= 1) {
foo.bar;
}
Comments which are helpful usually explain why something is done. That's usually to accommodate specific business rules which the AI isn't likely to know about at this stage. // This is due to a change Accounting requested because ...
if (foo.length <= 1) {
foo.bar;
}Again, I could be wrong; e.g., a banking application might have certain regulations it needs to follow making non-computer-technical reasons for certain things to be done. That would be a good candidate for a "helpful" comment which would be reasonably AI-generated. (Although, perhaps not a good candidate for an LLM-generated application.) The example of "our specific business wants this for reasons" is one that I think LLMs would struggle with unless that's included in the context window. Of course, that's also possible; not sure if that is presumed.