Kotlin으로 코드 행을 20% 줄이고 팀의 사기를 진작시킨 SmartNews
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.

SmartNews는 다양한 뉴스 매체의 뉴스를 적시에 공유하여 수백만 명의 사용자가 매일 자신의 세계를 발견하도록 돕습니다. 2012년 일본에서 설립된 SmartNews는 현재 전 세계적으로 5천만 회 이상이라는 앱 다운로드 기록을 보유하고 있습니다.
2019년 6월 SmartNews의 개발팀은 Android 개발이 Kotlin 중심으로 전환되는 것을 보면서 자체 Kotlin 테스트를 시작하기로 했습니다. 개발팀은 Kotlin 중심의 Jetpack 라이브러리를 활용하여 유지 관리할 코드 양을 줄이고, Kotlin의 풍부한 표현과 이해하기 쉬운 구문의 이점을 누리고자 했습니다.
무엇을 했나
SmartNews의 개발팀은 자바에 매우 능숙했으므로 Kotlin 작성을 시작하기가 쉬웠습니다. Kotlin은 자바와 100% 호환되므로 기존 코드베이스를 사용하면서 Kotlin에서 Weather Radar 및 News From All Sides와 같은 새로운 기능을 쉽게 작성할 수 있습니다. 개발팀에서는 특허받은 기능인 Weather Radar 내에서 이미지 다운로드 및 캐싱을 관리하기 위해 코루틴을 사용했습니다.
코루틴 디스패처는 작업 관리에 유용한 추상화를 제공하여 SmartNews 엔지니어가 원시 스레드 관리에서 발생하는 위험을 방지하는 데 도움이 되었습니다.
또한 개발팀은 자바 코드의 일부를 리팩터링했으며 Kotlin의 null 안전성 기능에 감탄했습니다. 변경 가능성, null 허용 여부 및 초기화를 식별하는 Kotlin 구문은 개발팀에서 초기에 오류를 잡아내는 데 도움이 되었으며 코드 변경을 검토하는 데 드는 시간을 10% 단축해 줬습니다.
또한 Kotlin의 간결하면서도 효율적인 구문을 사용하여 코드베이스의 가독성을 높일 수 있었으며, 이를 통해 회사가 계속 성장할수록 코드를 더 쉽게 유지 관리할 수 있게 되었습니다.
결과
Kotlin으로 작성하면서 구현에서 출시까지 전체적인 생산성이 향상되었습니다. 팀에서 확인한 가장 큰 개선사항은 Kotlin으로 작성하면 변환된 코드 행이 20% 감소한다는 것입니다.
현재 SmartNews 앱의 약 절반이 Kotlin으로 작성되었으며 개발팀은 코드 유지 관리 가능성을 계속 높이기 위해 기존 코드의 일부를 리팩터링하고 모든 신규 기능을 Kotlin으로 개발할 계획입니다.
개발팀은 Kotlin을 구현하고 상용구 코드를 줄이면서 팀의 사기가 증가하는 것을 목격했습니다. 개발팀은 아이디어를 더 효율적인 방법으로 표현할 수 있으며 향후 코드의 가독성이 더 좋아진다는 사실에 큰 관심을 보였습니다. SmartNews의 엔지니어링 관리자인 오오하시 히데오는 Kotlin이 엔지니어링 채용에도 도움이 된다는 사실을 발견했습니다. “지원자가 가장 자주 묻는 질문은 'Kotlin을 사용하고 있나요? 얼마나 자주 사용하시나요?'입니다. 이제 많은 엔지니어가 Kotlin으로 이전하는 것에 관심이 있으며 이를 지원하려고 합니다." 팀 사기 개선과 채용에서의 이점이 팀에서 Kotlin을 채용한 주된 이유는 아니지만, 이러한 긍정적인 변화는 경쟁이 치열한 업계에서 회사가 계속 성장하는 데 도움이 될 것입니다.
시작하기
Kotlin으로 Android 앱 개발하기에 관해 자세히 알아보세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2021-01-06(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2021-01-06(UTC)"],[],[],null,["# SmartNews reduces lines of code by 20% and improves team morale with Kotlin\n\n[SmartNews](https://play.google.com/store/apps/details?id=jp.gocro.smartnews.android)\nhelps millions of people discover their world everyday by sharing timely news\nfrom a diverse set of news sources. The company was founded in 2012 in Japan,\nand it now has over 50 million downloads globally.\n\nIn June 2019, the team saw Android development moving towards Kotlin first and\ndecided to start testing Kotlin themselves. They wanted to take advantage of\nKotlin-first Jetpack libraries, reduce the amount of code they had to maintain,\nand benefit from Kotlin's expressive and easy-to-understand syntax.\n\nWhat they did\n-------------\n\nThe team at SmartNews is well versed in Java, so it was fairly easy for them to\nstart writing in Kotlin. As Kotlin is 100% interoperable with Java, they could\neasily start writing new features such as\n[Weather Radar and News From All Sides](https://about.smartnews.com/en/2020/09/17/20200917/)\nin Kotlin, while working in their existing codebase. They used coroutines to\nmanage image downloading and caching within the patented Weather Radar feature.\nCoroutine dispatchers provide a useful abstraction for managing tasks, and this\nhelped the SmartNews engineers avoid the pitfalls that come from managing raw\nthreads.\n\nThe team also refactored some of their Java code, and was impressed with\nKotlin's null safety features. Kotlin's syntax for identifying mutability,\nnullability, and initialization helped the team catch errors early on,\nand **reduced the amount of time to review code changes by 10%**.\nUsing Kotlin's succinct and efficient syntax, they were also able to increase\nthe readability of their codebase, which has made their code easier to maintain\nas the company continues to grow.\n\nResults\n-------\n\nWriting in Kotlin has **improved their overall productivity from\nimplementation to launch** . The biggest improvement they saw was that\nwriting in Kotlin **reduced their converted lines of code by 20%**.\nApproximately half of the SmartNews app is currently in Kotlin, and the\ndevelopment team plans on writing all new features in Kotlin as well as\nrefactoring some of their existing code in order to continue increasing their\ncode maintainability.\n\nAs the development team was implementing Kotlin and reducing boilerplate code,\nthey noticed an **increase in team morale** . The team was excited\nto be able to express their ideas in a more efficient way, and have their code\nbe more readable for the future. Hideo Ohashi, the Engineering Manager for\nSmartNews noticed **Kotlin has helped their engineering recruiting\nefforts** . *\"The most frequent questions from candidates are 'are you\nusing Kotlin? How often do you use it?' It seems now that many engineers are\ninterested in migrating to Kotlin and want to support it.\"* While these\nimprovements in team morale and recruitment were not the main reasons the team\nadopted Kotlin, these positive changes will help the company as it continues to\ngrow in this competitive industry.\n\nGet started\n-----------\n\nLearn more about [developing an Android app with Kotlin](/kotlin)."]]