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

将 Kotlin 应用于现有 Java 代码的策略 #1849

Merged
merged 2 commits into from
Jul 13, 2017
Merged

Conversation

Luolc
Copy link
Contributor

@Luolc Luolc commented Jul 4, 2017

@skyar2009
Copy link

@skyar2009
Copy link

校对认领

@linhe0x0
Copy link
Member

linhe0x0 commented Jul 5, 2017

@skyar2009 好的呢 🍺

Copy link

@skyar2009 skyar2009 left a comment

Choose a reason for hiding this comment

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

done


![](https://ws3.sinaimg.cn/large/006tKfTcly1fh3l62xqunj30wo0fggn4.jpg)

A few months ago, when I was present in a Kotlin related environment, probably the most recurrent question was whether it was a good time to start a migration into Kotlin. My answer was always invariably **YES**. There were many benefits and almost no drawbacks if you proceeded with a Kotlin migration. The only technical drawback I could think of was increasing the method count number, since kotlin-stdlib adds (currently) [7191 new methods](https://blog.jetbrains.com/kotlin/2016/03/kotlins-android-roadmap/). Considering the new benefits on the table, that was a more than acceptable disadvantage.
几个月前,当我出现在与 Kotlin 相关的讨论、社区中时,可能最常被问及的问题是,现在是否是一个迁移至 Kotlin 的好时机。我的回答始终没有改变过:**是的**。进行 Kotlin 迁移有很多收益,且几乎没有任何坏处。我所能想到的唯一一个技术上的副作用是方法数将会增多,因为 Kotlin 标准库(目前)增加了 [7191 个新方法](https://blog.jetbrains.com/kotlin/2016/03/kotlins-android-roadmap/)。考虑到因此能够获得的收益,这是一个完全可以接受的不足。

Choose a reason for hiding this comment

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

考虑到因此能够获得的收益

综合利弊

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


![](https://ws3.sinaimg.cn/large/006tKfTcly1fh3l62xqunj30wo0fggn4.jpg)

A few months ago, when I was present in a Kotlin related environment, probably the most recurrent question was whether it was a good time to start a migration into Kotlin. My answer was always invariably **YES**. There were many benefits and almost no drawbacks if you proceeded with a Kotlin migration. The only technical drawback I could think of was increasing the method count number, since kotlin-stdlib adds (currently) [7191 new methods](https://blog.jetbrains.com/kotlin/2016/03/kotlins-android-roadmap/). Considering the new benefits on the table, that was a more than acceptable disadvantage.
几个月前,当我出现在与 Kotlin 相关的讨论、社区中时,可能最常被问及的问题是,现在是否是一个迁移至 Kotlin 的好时机。我的回答始终没有改变过:**是的**。进行 Kotlin 迁移有很多收益,且几乎没有任何坏处。我所能想到的唯一一个技术上的副作用是方法数将会增多,因为 Kotlin 标准库(目前)增加了 [7191 个新方法](https://blog.jetbrains.com/kotlin/2016/03/kotlins-android-roadmap/)。考虑到因此能够获得的收益,这是一个完全可以接受的不足。

Choose a reason for hiding this comment

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

我的回答始终没有改变过:是的

我的回答始终不会变:是的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Now that the answer to that question is affirmative without any kind of palliatives, I realised there is another question floating around: *how is the process to start adopting Kotlin?*
既然这个问题的答案是毫无争议的肯定的,我意识到另一个问题在浮现出来:**应用 Kotlin 会经过什么样的步骤?**

Choose a reason for hiding this comment

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

应用 Kotlin 会经过什么样的步骤?

开始使用 Kotlin 应该采取什么样的步骤?

Choose a reason for hiding this comment

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

既然这个问题的答案是毫无争议的肯定的
去掉“肯定的”中的“的”
既然这个问题的答案是毫无争议的肯定

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


In this article I am aiming to provide a few ideas for those of you confused about where to start or looking for new ideas.
我的目的是通过本文向那些困惑从何开始或寻求灵感的人们提供一些自己的想法。

Choose a reason for hiding this comment

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

我的目的是通过本文向那些困惑从何开始或寻求灵感的人们提供一些自己的想法。

本文的意图是向那些困惑从何开始或寻求灵感的人们提供一些自己的想法。

+我的目的是通过本文向那些困惑从何开始或寻求灵感的人们提供一些自己的想法。
 

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Yes, I am aware that tests are limited in nature. A Unit Test means exactly that: you are testing individual units and modules. It is hard to develop complex architectural nets when all you have is a bunch of single classes and maybe a few helper ones. But this is a very cheap and effective way to build awareness and spread knowledge of the new language.
是的,我知道测试本质上是受限很多的。单元测试正意味着:你正在测试各个独立的单元和模块。当你所拥有的一切只是一群单独的类和可能的少量辅助类时,开发复杂的架构网是很困难的。但是这是一种对新语言建立认知和拓展的非常廉价和高效的方法。

Choose a reason for hiding this comment

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

我知道测试本质上是受限很多的

我知道测试是有限制性的

Choose a reason for hiding this comment

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

单元测试正意味着:你正在测试各个独立的单元和模块。

单元测试确切是指:你所测试的独立单元和模块。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@Luolc
Copy link
Contributor Author

Luolc commented Jul 10, 2017

@skyar2009 @sqrthree 一校结果已修改完。

Copy link
Contributor

@phxnirvana phxnirvana left a comment

Choose a reason for hiding this comment

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

一些微小的建议。翻得很棒


Since the latest announcement at the Google I/O, things have been crazy. At the [Kotlin Weekly](http://www.kotlinweekly.net/) Mail List we had an increase in subscribers over 20% in the last two weeks, over 200% increase in article submissions, and at a Meetup I organise ([Kotlin Users Group Munich](https://www.meetup.com/Kotlin-User-Group-Munich/)) we had a huge increase in attendees. And all this combined with the general blast in the developers community.
Google I/O 大会上发布最新消息起,事情变得疯狂起来。在过去的两周内,[Kotlin 周报](http://www.kotlinweekly.net/)邮件列表的订阅人数增长了 20% 以上,文章提交数增长超过 200%。我所组织的线下交流([Kotlin 慕尼黑用户组](https://www.meetup.com/Kotlin-User-Group-Munich/))的参与人数大幅增长。所有这一切伴随着开发者社区总体的爆发性增长。
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 Author

Choose a reason for hiding this comment

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

Done.

It is somehow obvious now where the future is leading. Although Google promised to keep support for Java, the legal battle between [Google and Oracle](https://en.wikipedia.org/wiki/Oracle_America,_Inc._v._Google,_Inc.) and the clear fact that Kotlin is a more succinct, effective and powerful language is marking the direction in a sea of reads. I found this tweet to be fairly predictive.
一个还会不断增长的趋势。

总之现在来看,未来将会如何发展是很显然的。尽管 Google 承诺将继续支持 Java,但 [Google 和 Oracle 之间的法律纠纷](https://en.wikipedia.org/wiki/Oracle_America,_Inc._v._Google,_Inc.)和 Kotlin 是一个更加简洁、高效、强大的语言的清晰事实正在标志着你学习的方向。我发现下面这个推文相当有预见性。
Copy link
Contributor

Choose a reason for hiding this comment

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

和 Kotlin 是一个更加简洁

改成以及 Kotlin ……是不是更好

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.


Yes, I am aware that tests are limited in nature. A Unit Test means exactly that: you are testing individual units and modules. It is hard to develop complex architectural nets when all you have is a bunch of single classes and maybe a few helper ones. But this is a very cheap and effective way to build awareness and spread knowledge of the new language.
是的,我知道测试是有限制性的。单元测试确切是指:你所测试的独立单元和模块。当你所拥有的一切只是一群单独的类和可能的少量辅助类时,开发复杂的架构网是很困难的。但是这是一种对新语言建立认知和拓展的非常廉价和高效的方法。
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 Author

Choose a reason for hiding this comment

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

Done.

@linhe0x0
Copy link
Member

@Luolc 两位校对者都已经校对好了~ 可以来根据校对意见进行调整了哈 ┏ (゜ω゜)=☞

@Luolc
Copy link
Contributor Author

Luolc commented Jul 11, 2017

@phxnirvana @sqrthree 二校结果已修改完。

linhe0x0
linhe0x0 previously approved these changes Jul 12, 2017
Copy link
Member

@linhe0x0 linhe0x0 left a comment

Choose a reason for hiding this comment

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

校对者信息加一下吧,然后就可以 merge 了。

@@ -3,74 +3,75 @@
> * 原文作者:[Enrique López Mañas](https://medium.com/@enriquelopezmanas)
> * 译文出自:[掘金翻译计划](https://github.com/xitu/gold-miner)
> * 本文永久链接:[https://github.com/xitu/gold-miner/blob/master/TODO/on-strategies-to-apply-kotlin-to-existing-java-code.md](https://github.com/xitu/gold-miner/blob/master/TODO/on-strategies-to-apply-kotlin-to-existing-java-code.md)
> * 译者:
> * 译者:[Luolc](https://github.com/Luolc)
> * 校对者:
Copy link
Member

Choose a reason for hiding this comment

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

校对者信息要加一下哈

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@linhe0x0 linhe0x0 merged commit ff751b2 into xitu:master Jul 13, 2017
@linhe0x0
Copy link
Member

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

@Luolc Luolc deleted the translate branch July 13, 2017 03:44
@Luolc
Copy link
Contributor Author

Luolc commented Jul 13, 2017

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.

4 participants