主题
IT 英语:代码注释与英文邮件模板
六、代码注释常用英文表达(写规范注释不用查)
原则:注释写为什么(Why),不是做什么(What)——做什么看代码就知道。
| 要表达的意思 | 英文写法 |
|---|---|
| 修复 xxx 问题(Bug #123) | Fix: xxx issue (#123) |
| 为解决 xxx 场景,增加以下兼容处理 | Add compatibility for xxx scenario |
| 这里为什么这么写,而不是那么写 | Note: We use A instead of B because ... |
| 这个函数很容易被误用,注意事项 | Warning: Do NOT call this in ... it will cause ... |
| TODO:以后要优化/重构 | TODO: Optimize this query when table grows beyond X rows |
| FIXME:当前实现是临时/粗糙的 | FIXME: Hacky implementation, replace with proper approach |
| 这个参数能传什么值 | @param `{'asc' |
| 这个函数返回什么 | @returns {Promise<User[]>} Array of matched users |
| 什么情况会抛异常 | @throws {AuthError} If token is missing or invalid |
| 例子怎么用 | @example const users = await findUsers({ name: 'Tom' }) |
| 弃用:以后不要用了,改用什么 | @deprecated Use newFunction() instead. Will be removed in v2. |
| 兼容老版本:这个判断可以在 x 版后删 | Legacy check for v1.x, can remove after v2.0 release |
| 业务特殊:这段逻辑是 PM 要求的,别随便改 | Special business rule required by product: Don't simplify. |
| 为什么这里睡 100ms:等 xxx 事件先触发 | Sleep 100ms to wait for state update before next step |
七、开发工作英文邮件/IM 模板(直接抄)
7.1 代码审查(PR / MR 描述)
## Summary(总结做了什么)
- Implemented user login page with SMS verification
- Fixed bug where logout didn't clear session cache (#234)
## How to test(怎么测)
1. Open `/login`
2. Enter phone + click "Send code"
3. Enter received code → should redirect to dashboard
4. Click logout → confirm session cleared (need re-login)
## Screenshot(有 UI 变更加截图)
[Before] vs [After]
## Notes(需要 reviewer 特别注意的地方)
- The token encryption logic in `utils/auth.js` is sensitive, please double-check
- Compatible with old sessions (no breaking change for online users)7.2 给同事/后端要接口
Hi [Name],
Could you help provide an API for the following?
- Endpoint: GET /api/users/{id}
- Response fields: id, name, avatar, role, phone
- Permission: only accessible by admin and the user himself/herself
Need it by EOD Friday if possible (we need to test before next Monday's release).
Let me know if any questions, thanks!7.3 请假/临时外出
Hi team,
I'll be out of office tomorrow (Aug 26) for personal leave.
For urgent matters, please reach me on WeChat or call [phone].
My work for this week:
- [X] Login page API integration
- [ ] Code review for PR #234 (will finish by EOD today, or if not, Tom can cover)
Thanks!7.4 线上出 Bug,通知相关方
Subject: [Incident] Production login service down @ 15:30
Team,
We are seeing a spike of 500 errors on login endpoint starting 15:30.
Current status:
- Impact: Users cannot log in (existing sessions work fine)
- Root cause: Under investigation, initial suspect is Redis connection pool exhausted
- Action taken: Restarted 2 of 4 pods, error rate down 30%
- ETA for fix: 30 minutes
Will update every 15 minutes.7.5 IM 高频短句(Slack/Teams/英文钉钉)
| 中文意思 | 英文说法 | 发音 |
|---|---|---|
| 收到 / 好的 | Got it / Noted / Affirmative | /əˈfɜːrmətɪv/ |
| 我看一下 | Let me check / Taking a look now | |
| 马上处理 | On it / Will do right now | |
| 处理好了 | Done / Fixed / Resolved | |
| 我来搞定 | I'll handle it / On me | |
| 稍等 | One sec / Give me a minute | |
| 等我回复 | I'll get back to you shortly | |
| 能帮忙看下吗? | Could you please take a look? | |
| 能帮我 merge 一下吗 | Could you help merge this when you get a chance? | |
| 阻塞了,等你回复 | Blocked on this, waiting for your input | /blɒkt/ |
| 我觉得/我的建议 | My 2 cents: / Personally I'd suggest | |
| 同意 | +1 / Agreed / Same here | |
| 有道理 | Makes sense / Good point | |
| 我有不同看法 | I'm not sure I agree — here's why: | |
| 我更新了/我补充了 | Just updated the doc / Added notes below | |
| 抱歉回复晚了 | Sorry for the late reply | |
| 抱歉打扰了(下班时间找人) | Sorry to bother you after hours, but this is urgent | |
| 我们约个会同步下? | Shall we schedule a quick sync to align? | /sɪŋk/ |
| 没问题 / 可以 | Works for me / No problem | |
| 不行 / 做不到 | That might not work, because ... | |
| 截止时间是什么时候 | What's the deadline for this? | /ˈdedlaɪn/ |
| 进展如何 | Any update on this? / What's the ETA? | /iː tiː eɪ/ |
| 上线了 / 发布成功了 | Deployed successfully / Live in production | /dɪˈplɔɪd/ |
| 回滚了 | Rolled back to previous version | /roʊld bæk/ |
使用建议
- 报错只抓关键词:不要整段复制去搜,挑 2-3 个核心词,比如
401 Unauthorized token→ 中文谷歌或 Stack Overflow 直接搜。 - 注释先写中文后翻英文:写不出的表达先记中文,再查;或者先用 AI 翻译再润色,不要写中式英语让外国同事猜。
- 邮件开头别太客气结尾别忘署名:Hi 名字 / Dear 名字,正文开门见山,结尾 Best regards / Thanks + 名字就够了,不用扯"最近好吗"浪费时间。