Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update iterator translate #40

Closed
wants to merge 1 commit into from
Closed

Conversation

hotoo
Copy link
Contributor

@hotoo hotoo commented Mar 12, 2015

  • 通常将 iterator 翻译为 迭代器。(Github diff 中文只能到语句级别,其实我只是修改 遍历器迭代器。)
  • 行尾空白是编辑器自动去掉的,建议不要保留 :)

@ruanyf
Copy link
Owner

ruanyf commented Mar 15, 2015

iterator 的通常译名确实是迭代器,但是我觉得,“遍历”和“迭代”的意思不一样,后者有递进的意思。

var a = [1,2,3];

for (i of a) {
  console.log(i);
}

上面的操作,称为“遍历操作”要比称为“迭代操作”更合适。所以,我还是想保留“遍历器”的译法。

@hax
Copy link

hax commented Mar 15, 2015

个人建议用“迭代器”。两个原因:

  1. “迭代器”已经是iterator的最常见译法。此可由google搜索验证——“迭代器”比“遍历器”要高两个数量级。

    我个人偶尔也会用自创译法(参见 http:https://hax.iteye.com/category/26282 ),但只在尚未有压倒性优势译法时,或者有2到3种数量级差不多的译法时。否则即使惯用译法有再多问题,也沿用之。原因是已约定俗成,创制新译法所得之好处很可能不足以cover掉读者由惯用译法转换到新译法的理解成本。

  2. “迭代器”的译法本身并无瑕疵。

    我估计你觉得“迭代”有递进之意是来自于迭代式开发,但是“迭代”一词本身并无递进之意,“迭代”的本意是“重复过程以达到目标”(参见http:https://en.wikipedia.org/wiki/Iteration)。

    另一方面,“遍历”暗含的意思是那些数据已经存在,我只是逐个访问并给出。实际上迭代器可能是实时计算结果,并不存在预先的数据。由此来说“遍历器”的译法其实反而存在瑕疵。

如果说“迭代器”存在缺点,或许是对于纯粹小白读者来说,完全不明白“迭代”是什么意思,而“遍历”则还能大概理解。此时我建议用注解来帮助读者,而不要在译名上降低难度。毕竟专业词汇包含了特定内涵,本身也是需要学习的。

以上是我的一点浅见,谨供参考。

@hotoo
Copy link
Contributor Author

hotoo commented Mar 16, 2015

@ruanyf 你自己做决定好了 :)

@jerrylau91
Copy link

关于迭代的含义讨论的还是很深入的!

@hotoo hotoo closed this Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants