介绍下用英文写作计算机博客的一些经验。
常见的表达
避免直接翻译汉语词
少用汉语式的名词化表达,例如“执行 xx 行动”,“处理 xx 过程”。
1 | the lock is released |
不要自以为是去形容词化。如下,adaptive 的意思是自适应的,和我们实际要指代的“适配代码的行为”是不对应的。
1 | We need to **adapt** the code to the new behavior. However, this **adaptive** work is not easy. |
实词虚化、具体词抽象化
汉语中,很多虚词功能是通过复用实词来的。但是在英语中,如果有对应的虚词,就不要直接翻译汉语中的实词了。
1 | Based on this reason, ... |
又例如下面的“带来麻烦”,这里的带来没必要用 bring 这个实词
1 | brings lots of trouble to investigate ... |
又例如下面的“定位到问题”
1 | The problem is located by ... |
虚词实化
但是,一些汉语中的虚词,在英语中要实化。例如,“这会导致难以理解的代码”,就是
1 | It could result in confusing codes. |
这个原则甚至不限于词,对于任何表达都是这样。This may cause problems,建议直接具体一点说是什么 problems。如
1 | This behavior can cause a deadlock when two tasks hold the mutex across an await point. |
需要调整句子结构
尽量避免使用形式主语 It is 或者 there is 等来拖长表达
1 | It is hard to inspect the state. |
但注意,非形式主语是可以用 it 的,如下所示,这好过说 “I think” 等
1 | It indicates ... |
从下面的例子中,能感觉到动名词前置的用法,更干练
1 | I don't think the service itself should persist the updated configuration to the config file. Instead, this should be handled by the operator. |
语序
副词顺序应该稳定在动词后。
1 | We must immediately do this. |
其他
下面的表达,相比更能体现出不仅不能做之前说的,也不能做现在说的。而 Also 显得更像一个连接。
1 | Also, A can't do sth. |
使用更恰当的单词
使用更精确的词
避免使用
possible -> feasible
使用恰当的搭配
动名词搭配。
辩证具体含义的差别
如:
宏观写法
先给结论,再给解释(Top-down writing)。
特定场景的表达
偏向数据分析
表达“A使用的内存占A的调用者的比重,相比B使用的内存占B调用者的比重是相近了”,从书面到口语。
1 | // 这里的 footprint 更专业术语一点。 |