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

Typescript : 类 vs 接口 #3375

Merged
merged 4 commits into from Mar 12, 2018
Merged

Typescript : 类 vs 接口 #3375

merged 4 commits into from Mar 12, 2018

Conversation

xueshuai
Copy link
Contributor

@xueshuai xueshuai commented Mar 5, 2018

译文翻译完成,resolve #3335

@Starriers
Copy link
Contributor

校对认领

@fanyijihua
Copy link
Collaborator

@Starriers 好的呢 🍺

@rpgmakervx
Copy link
Contributor

校对认领

@fanyijihua
Copy link
Collaborator

@rpgmakervx 妥妥哒 🍻

@rpgmakervx
Copy link
Contributor

@fanyijihua 原文无法打开?

@Starriers
Copy link
Contributor

@rpgmakervx 正常浏览是打不开的 需要方法。但是不影响校对

@leviding leviding added the 前端 label Mar 5, 2018
Copy link
Contributor

@Starriers Starriers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xueshuai @fanyijihua 校对完成


When you are defining a contract, you want to use an interface. That’s it, no arguing about that … but then, when to use a class ?
John Papa has got his definition in this article :
当你定义一个约定,你是想使用一个接口。一定是的,不可辩驳……但是,当你想使用一个类的时候呢?John Papa 已经在他的文章中指出了他的定义:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

原文这是两句话,最后一段也是,我还是觉得尊重原文比较好,可以意译,但是排版,一定有作者自己的风格。

Copy link
Contributor

@rpgmakervx rpgmakervx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xueshuai @fanyijihua 校对完成


> Traditional JavaScript uses functions and prototype-based inheritance to build up reusable components, but this may feel a bit awkward to programmers more comfortable with an object-oriented approach, where classes inherit functionality and objects are built from these classes.
> 传统的 Javascript 使用函数和基于原型的继承来构造可服用的组件,但是这会让那些对面向对象方法更舒服的程序员感到一些尴尬,在面向对象方法中,类继承了功能,而对象是通过累来构造的。
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

而对象是通过 类 来构造的, 此处“类” 错打成了 累

@xueshuai
Copy link
Contributor Author

xueshuai commented Mar 6, 2018

@rpgmakervx @Starriers @fanyijihua 修改完成,请验收

@leviding
Copy link
Member

@xueshuai 哈哈,要记得是艾特我的

@leviding leviding merged commit 8db43cf into xitu:master Mar 12, 2018
@leviding
Copy link
Member

@xueshuai 已经 merge 啦~ 快快麻溜发布到掘金然后给我发下链接,方便及时添加积分哟。

掘金翻译计划有自己的知乎专栏,你也可以投稿哈,推荐使用一个好用的插件
专栏地址:https://zhuanlan.zhihu.com/juejinfanyi

@xueshuai
Copy link
Contributor Author

https://juejin.im/post/5aa79a106fb9a028db585eae 已经在掘金上发布啦 @leviding

@xueshuai
Copy link
Contributor Author

xueshuai commented Mar 13, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Typescript : 类 vs 接口
5 participants