Skip to content
← 返回英语列表
路线与能力起点

程序员英语 02:技术词汇与句子骨架 ​

遇到 The worker drains the queue before shutdown.,逐词查到“工人、排水、队伍”并不能帮助理解。开发语境中的意思是:工作线程或进程在关闭前处理完队列里的待处理项。先确认对象和动作,再确定词义。

把词汇放进动作里 ​

搭配在开发中的常见含义原创例句
parse a file按格式解析文件The parser rejects incomplete records.
validate input校验输入Validate the length before saving the value.
allocate memory分配内存The buffer allocates memory on demand.
release a lock释放锁Release the lock before running the callback.
handle an error处理错误The caller handles missing files.
raise an exception抛出异常The loader raises an exception for invalid syntax.
resolve a dependency解析或确定依赖The build tool resolves dependencies before compilation.
persist a change持久化修改The editor persists changes when you save.
retry an operation重试操作Retry the operation after checking the cause.
reproduce a failure复现失败I can reproduce the failure with this input.
backward compatible向后兼容The new reader is backward compatible with version 2 files.
deprecated已不推荐使用This option is deprecated but still accepted in this version.

同一个词随上下文改变含义:resolve a dependency 与 resolve an issue 的对象不同;argument 在函数调用里通常是实参,在讨论中可能是论点。词汇卡应记录完整搭配,避免只写一个中文对应词。

deprecated 不等于已经删除,removed 才表示移除;concurrent 强调任务在时间上交错推进,parallel 强调同时执行。读到这些词后,还要找版本与执行模型,不能只凭词表推断具体产品行为。

先找句子主干,再加限定 ​

看这句原创说明:

The cache stores values that are expensive to compute until they expire.

先抽出主干:The cache / stores / values,即缓存存储值。that are expensive to compute 修饰 values,说明是哪类值。until they expire 补充保留多久,they 指这些值。

按这个顺序阅读,比从左到右逐字翻译更容易保住整体含义:

  1. 谁做事:cache。
  2. 做什么:stores。
  3. 对什么做:values。
  4. 哪些值、何时结束:计算成本高,直到过期。

如果句子指代不清,不必猜作者意思。例如 The worker passes the buffer to the parser after it starts. 中 it 可能指 worker,也可能指 parser。写作时应直接重复名称。

几组会改变实现的表达 ​

表达应保留的逻辑
at least 3不少于 3,包含 3
at most 3不多于 3,包含 3
fewer than 3少于 3,不包含 3
only if the file exists文件存在是必要条件,不保证一定执行
unless the file exists除非文件存在,否则执行所述行为
may fail可能失败,不是在报告已失败
has failed已经发生失败

练习:保留技术含义 ​

  1. 翻译 The reader accepts at most 16 records unless strict mode is enabled.,并指出不能确定的内容。
  2. 把 The worker passes the buffer to the parser after it starts. 改成明确表达“解析器启动后再传入”的句子。
  3. 说明 The option is deprecated in version 4. 能否证明第 4 版已经不接受该选项。
查看答案与讲解
  1. 未启用严格模式时,读取器最多接受 16 条记录。严格模式启用后接受多少条,原句没有说明;不要自行补成零条或无限条。
  2. After the parser starts, the worker passes the buffer to it. 这里 it 有清晰指向;也可直接重复 the parser。
  3. 不能。需要另查移除计划和当前版本行为。可以表述为 The option is deprecated; check the migration guide for its replacement and removal schedule.

资料与延伸 ​

Google 开发者文档词汇表 可用于核对特定术语与写作惯例。它是编辑风格参考,不是所有项目必须遵守的词典。团队已有术语时,优先保持同一文档内的一致性。

继续阅读