-
Notifications
You must be signed in to change notification settings - Fork 5k
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
值类型导向编程 #4909
值类型导向编程 #4909
Conversation
@leviding 校对认领 |
@Bruce-pac 好的呢 🍺 |
TODO1/value-oriented-programming.md
Outdated
|
||
2. 无继承问题 | ||
|
||
通过继承来重用代码的方式是脆弱的。继承还会跟接口实现耦合,这使得代码重用变得更加困难。这是它的特性,但即使是使用面向对象的程序员也会告诉你他更喜欢”组合而不是继承“。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
『继承还会跟接口实现耦合』=> 『继承还将接口与实现耦合在一起』
TODO1/value-oriented-programming.md
Outdated
|
||
2. 无继承问题 | ||
|
||
通过继承来重用代码的方式是脆弱的。继承还会跟接口实现耦合,这使得代码重用变得更加困难。这是它的特性,但即使是使用面向对象的程序员也会告诉你他更喜欢”组合而不是继承“。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO1/value-oriented-programming.md
Outdated
@@ -83,7 +83,7 @@ extension Diagram : Drawable { | |||
} | |||
``` | |||
|
|||
This made it possible to define different renderers that worked easily with the given types. A main selling point was the ability to define a test renderer, which let you verify drawing by comparing strings: | |||
这使得为指定类型定义不同的、可轻松工作的渲染器成为了可能。一个最主要的卖点是定义测试渲染器的能力,它允许你通过比较字符串来验证绘制: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
『这使得为指定类型定义不同的、可轻松工作的渲染器成为了可能』=> 『这使得定义根据给定类型并能为此轻松工作的各种渲染器变的可能』
@nanjingboy 可以修改啦 |
@leviding 修改完成 |
@nanjingboy 还有一个没改,标点符号 |
@Bruce-pac 不好意思,没注意 |
@nanjingboy 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。 掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件。 |
译文翻译完成,resolve #4901