GitHub Copilot and similar AI code assistance tools are becoming increasingly popular for good reasons. However, the way they require the use of basic comments to generate code is problematic. This practice overloads the traditional role of comments, which is undesirable. Well-placed comments are invaluable for helping programmers understand specific parts of code, but with AI overloading comments, it may become difficult to distinguish between useful comments and simplistic ones intended purely for AI.
Perhaps C++ should introduce a way to differentiate between comments meant for AI code generation and those meant for programmers. For example:
//$$ A function y that accepts an int x
void y(int x);
^^This "comment" is trivial, but you may still want to keep it for future refactoring purposes.
A good IDE could hide or collapse such "source text" used for AI-generated code by default, making sure that when comments are visible, they are meant to aid programmers rather than serve as prompts for AI. In this example, "//$$" is used as a placeholder to mark such comments, though a more suitable convention could be adopted.
d3fault