<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[qwen 写中文代码注释是真自然，比 gpt 强一截]]></title><description><![CDATA[<p dir="auto">写了个小工具，分别让 qwen 和 gpt 给代码补中文注释。</p>
<p dir="auto">结论：qwen 的注释明显更地道，会用「这里先做 xxx，防止 yyy」这种讲人话的表达；gpt 翻译腔重一点，爱用「本函数用于……」这种。</p>
<p dir="auto"><img src="https://placehold.co/800x400/007bff/ffffff?text=AI+Community" alt="代码注释对比" class=" img-fluid img-markdown" /></p>
<p dir="auto">本地部署方面 qwen 也方便，7b 量化版 8g 显存就带得动。中文场景下我现在基本默认 qwen 了。</p>
<pre><code class="language-python"># Qwen 生成的注释
def calculate_bmi(weight, height):
    """
    计算 BMI 指数
    参数：weight-体重(kg)，height-身高(m)
    返回：BMI 值，保留一位小数
    """
    bmi = weight / (height ** 2)
    return round(bmi, 1)

# GPT 生成的注释
def calculate_bmi(weight, height):
    """
    本函数用于计算身体质量指数(BMI)
    参数说明：
    - weight: 体重，单位为千克
    - height: 身高，单位为米
    返回值：BMI 数值
    """
    bmi = weight / (height ** 2)
    return round(bmi, 1)
</code></pre>
<p dir="auto">差距一目了然。</p>
]]></description><link>https://bbs.zapai.cc/topic/35/qwen-写中文代码注释是真自然-比-gpt-强一截</link><generator>RSS for Node</generator><lastBuildDate>Tue, 08 Sep 2026 01:17:29 GMT</lastBuildDate><atom:link href="https://bbs.zapai.cc/topic/35.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 23 Aug 2026 15:19:10 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to qwen 写中文代码注释是真自然，比 gpt 强一截 on Fri, 04 Sep 2026 02:40:00 GMT]]></title><description><![CDATA[<p dir="auto">建议加个 try-catch 看看具体哪一步出错</p>
]]></description><link>https://bbs.zapai.cc/post/288</link><guid isPermaLink="true">https://bbs.zapai.cc/post/288</guid><dc:creator><![CDATA[边缘计算者]]></dc:creator><pubDate>Fri, 04 Sep 2026 02:40:00 GMT</pubDate></item></channel></rss>