Skip to content

修改 第四章 Field tags and schema evolution 移除字段翻译的问题 - #325

Closed
SunVdong wants to merge 1 commit into
Vonng:masterfrom
SunVdong:master
Closed

SunVdong wants to merge 1 commit into
Vonng:masterfrom
SunVdong:master

Conversation

@SunVdong

@SunVdong SunVdong commented Sep 4, 2023

Copy link
Copy Markdown

原文是 :Removing a field is just like adding a field, with backward and forward compatibility concerns reversed.

原文是 :Removing a field is just like adding a field, with backward and forward compatibility concerns reversed.
@yingang

yingang commented Sep 4, 2023

Copy link
Copy Markdown
Collaborator

你好,建议这边仍然保留原译文的描述,对照上下文也很好理解,如果按英文直译我觉得反而有点拗口?

@SunVdong

SunVdong commented Sep 4, 2023

Copy link
Copy Markdown
Author

我的理解是,当删除一个可选字段时,旧代码可以读取新数据(该数据中删除了一个字段,且字段在原模式中可选的),旧代码默认此字段未设置(optional且没默认值)或使用此字段的默认值,这是向前兼容。
而向后兼容,新代码在读取旧数据(包含一个新模式中删除的字段标签号、类型和内容),新代码在读取是,压根没有读取该标签号,所以直接忽略,也是可以读取的。
我觉得原文 with backward and forward compatibility concerns reversed,想表达是,删除字段的模式演变的关注点与新增字段(上文两段中)的刚好相反
删除字段时 向前兼容旧代码使用默认值,而向后兼容时 新代码 忽略旧代码中未删除的字段,
新增字段时,向前兼容旧代码直接忽略新增字段,向后兼容时新代码读取时使用默认值,optional。

@yingang

yingang commented Sep 4, 2023

Copy link
Copy Markdown
Collaborator

我觉得原文 with backward and forward compatibility concerns reversed,想表达是,删除字段的模式演变的关注点与新增字段(上文两段中)的刚好相反

这句我同意的,我前面回复的意思更多是说直译出来会有点拗口,原文前面两段话是在说新增字段向后兼容性的影响,然后接下来这段是在说删除字段向前兼容性的影响,所以我觉得现在的译文感觉还更清楚一些。

@SunVdong SunVdong closed this Sep 6, 2023
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.

2 participants