是否有某种说法来指代代理(agent)添加的、泄露了提示(prompt)的评论类型?

3作者: xdennis11 天前
这是一个说明我意思的愚蠢例子。假设你有以下代码: ```python def create_background(width: int, height: int) -> Image: ... ``` 你让代理为 `create_background` 使用默认值,与 `create_screen` 中的默认值相同。它会将代码更改为: ```python # Now create_background params have default values, the same as create_screen in screen.py def create_background(width: int = DEFAULT_WIDTH, height: int = DEFAULT_HEIGHT) -> Image: ... ``` 不必要的注释是“vibed”代码的典型特征,但这种语气也让我感到恼火,因为它忽略了提示。它根据被要求做的事情来写注释,而不是以一种永恒的方式。 我在代码审查中不断告诉人们删除不必要的注释,我觉得我缺乏词汇来表达为什么这样做是错误的。
查看原文
This is a stupid example to illustrate what I mean. Say you have this code:<p><pre><code> def create_background(width: int, height: int) -&gt; Image: ... </code></pre> You tell the agent to use default values for create_background, the same as in create_screen. It changes the code to:<p><pre><code> # Now create_background params have default values, the same as create_screen in screen.py def create_background(width: int = DEFAULT_WIDTH, height: int = DEFAULT_HEIGHT) -&gt; Image: ... </code></pre> The unnecessary comment is a staple of vibed code, but the tone also annoys me because it leaves behind the prompt. It words comments based on what it was asked to do, not in a timeless manner.<p>I keep telling people in code reviews to remove unnecessary comments, and I feel I lack the vocabulary to express why this is bad.