Duolingo、Kotlin への移行完了でコード行数を平均 30% 削減
コレクションでコンテンツを整理
必要に応じて、コンテンツの保存と分類を行います。

Duolingo は、世界で最も人気のある言語学習プラットフォームの一つであり、Google Play で 2 億以上のダウンロードを誇る無料教育アプリの 1 つです。
多くの人が新しい言語を学ぶことで、より良い機会を手に入れます。3 億人以上の学習者に対して、利用しやすい言語教育を無料で提供すること。それが Duolingo の使命です。
Duolingo の取り組み

コードベースの行数が毎年 46% 増加している。それが判明したとき、Duolingo の Android デベロッパーは、全員一致で Java から Kotlin への移行を決定しました。
チームは、毎日リーダーボードでコンテストを実施し、学習を奨励することで、移行プロセスをゲーム化しました。まさに Duolingo のスタイルです。チーム内で Kotlin 経験が豊富なデベロッパーが「Kotlin チェッカー」となり、Android デベロッパーが全員 Kotlin のエキスパートになるまで、コードレビューでベスト プラクティスの共有を続けました。
2 年後に移行が完了すると、コードの保守性が大幅に向上しました。
ここで判明したのは、Java ファイルを Kotlin に変換すると、コード行数が平均 30%、場合によっては 90% も減少する、ということでした。
「全体的に、Kotlin に移行したことにとても満足しています。社内だけでなくソフトウェア業界全体で Kotlin の利用が増え続けていることを嬉しく思います。」- シニア スタッフ ソフトウェア エンジニア Art Chaidarun 氏
結果
サービスに新しい機能が加わり、稼働するデベロッパーの数が 2 倍になったにもかかわらず、コードベースのサイズは 2 年前の移行時とほぼ変わりませんでした。この事実が、投資の判断は正しかったことを証明しています。さらに、社内アンケートの結果、デベロッパーの満足度が 129 NPS ポイントも急上昇し、その主な理由として挙げられたのが Kotlin でした。
Duolingo は、言語のように、常に拡大、進化しています。厳格な A/B テストとアプリ内フィードバックに基づいて、チームは引き続き手法を改良し、世界最高レベルの言語教育を提供していきます。Duolingo には、それを実現するための、高い信頼性と有効性を備えた Kotlin 100% コードベースの Android アプリがあるのです。
始める
詳細については、Kotlin で Android アプリを開発するをご覧ください。
このページのコンテンツやコードサンプルは、コンテンツ ライセンスに記載のライセンスに従います。Java および OpenJDK は Oracle および関連会社の商標または登録商標です。
最終更新日 2020-05-15 UTC。
[null,null,["最終更新日 2020-05-15 UTC。"],[],[],null,["# Duolingo completes migration to Kotlin and reduces its line count by an average of 30%\n\n[Duolingo](https://play.google.com/store/apps/details?id=com.duolingo&hl=en_US)\nis one of the most popular language learning platforms in the world, and one of\nthe most-downloaded free education apps on Google Play, with more than 200\nmillion downloads.\n\nThe majority of people learn a new language to gain access to better\nopportunities, and it's Duolingo's mission to provide free and accessible\nlanguage education to its 300+ million learners.\n\nWhat they did\n-------------\n\nAfter seeing that their codebase's line count was growing 46% every year, a\nunanimous decision was made by Duolingo's Android developers to migrate from\nJava to Kotlin.\n\nIn true Duolingo style, the team gamified the migration process by running a\ncontest with a daily leaderboard and encouraging learning. The team's\nexperienced Kotlin developers became \"Kotlin checkers\" and shared best practices\nin code reviews, until all the Android developers became Kotlin experts\nthemselves.\n\nAfter two years the migration was complete, [dramatically improving code\nmaintainability](https://blog.duolingo.com/migrating-duolingos-android-app-to-100-kotlin/).\nThey found that **converting a Java file to Kotlin reduced its line count by an\naverage of 30%, and in certain cases by as much as 90%**.\n\n\"Overall we're very happy that we migrated to Kotlin when we did, and we're\nexcited to see its usage continue to grow both within our company and throughout\nthe software industry!\" - Art Chaidarun, Sr. Staff Software Engineer\n\nResults\n-------\n\nDespite having new product features and more than double the number of active\ncontributors, their codebase is nearly the same size as it was before the\nmigration two years ago, proving that the decision was a good investment. What's\nmore, internal surveys show their **developer satisfaction has skyrocketed by\n129 NPS points**, and Kotlin is a major factor cited in responses.\n\nDuolingo is always expanding and evolving, just like languages. [Rigorous A/B\ntesting](https://www.youtube.com/watch?v=xAx0ccvKw-M) and in-app feedback ensure\nthe team will continue to refine methodology and offer the best language\neducation in the world. Now with their Android app having a 100% Kotlin\ncodebase, they can do so with even more confidence and efficacy.\n\nGet started\n-----------\n\nLearn more about [developing an Android app with Kotlin](/kotlin)."]]