SmartNews কোডের লাইন 20% হ্রাস করে এবং Kotlin এর সাথে দলের মনোবল উন্নত করে
সেভ করা পৃষ্ঠা গুছিয়ে রাখতে 'সংগ্রহ' ব্যবহার করুন
আপনার পছন্দ অনুযায়ী কন্টেন্ট সেভ করুন ও সঠিক বিভাগে রাখুন।

SmartNews বিভিন্ন সংবাদ উৎস থেকে সময়মত খবর শেয়ার করার মাধ্যমে প্রতিদিন লক্ষ লক্ষ মানুষকে তাদের বিশ্ব আবিষ্কার করতে সাহায্য করে। কোম্পানীটি 2012 সালে জাপানে প্রতিষ্ঠিত হয়েছিল এবং এটি এখন বিশ্বব্যাপী 50 মিলিয়নেরও বেশি ডাউনলোড হয়েছে।
জুন 2019-এ, দলটি অ্যান্ড্রয়েড বিকাশকে প্রথমে কোটলিনের দিকে অগ্রসর হতে দেখে এবং নিজেরাই কোটলিন পরীক্ষা শুরু করার সিদ্ধান্ত নেয়। তারা কোটলিন-প্রথম জেটপ্যাক লাইব্রেরিগুলির সুবিধা নিতে চেয়েছিল, তাদের বজায় রাখার জন্য কোডের পরিমাণ কমাতে এবং কোটলিনের অভিব্যক্তিপূর্ণ এবং সহজে বোঝার সিনট্যাক্স থেকে উপকৃত হতে চেয়েছিল।
তারা কি করেছিল
স্মার্টনিউজের দলটি জাভাতে পারদর্শী, তাই তাদের পক্ষে কোটলিনে লেখা শুরু করা মোটামুটি সহজ ছিল। যেহেতু কোটলিন জাভার সাথে 100% ইন্টারঅপারেবল, তারা তাদের বিদ্যমান কোডবেসে কাজ করার সময় সহজেই নতুন বৈশিষ্ট্য যেমন ওয়েদার রাডার এবং কোটলিনের সব দিক থেকে সংবাদ লেখা শুরু করতে পারে। পেটেন্ট ওয়েদার রাডার বৈশিষ্ট্যের মধ্যে ইমেজ ডাউনলোড এবং ক্যাশিং পরিচালনা করতে তারা কোরোটিন ব্যবহার করেছিল। কোরাউটিন প্রেরকরা কাজগুলি পরিচালনা করার জন্য একটি দরকারী বিমূর্ততা প্রদান করে এবং এটি স্মার্টনিউজ ইঞ্জিনিয়ারদের কাঁচা থ্রেডগুলি পরিচালনা করার ফলে আসা সমস্যাগুলি এড়াতে সহায়তা করে৷
দলটি তাদের জাভা কোডের কিছু রিফ্যাক্টরও করেছে এবং কোটলিনের শূন্য নিরাপত্তা বৈশিষ্ট্যে মুগ্ধ হয়েছে। পরিবর্তনশীলতা, শূন্যতা এবং আরম্ভ সনাক্তকরণের জন্য কোটলিনের সিনট্যাক্স টিমকে প্রথম দিকে ত্রুটি ধরতে সাহায্য করেছিল এবং কোড পরিবর্তনগুলি পর্যালোচনা করার সময় 10% কমিয়েছিল । কোটলিনের সংক্ষিপ্ত এবং দক্ষ সিনট্যাক্স ব্যবহার করে, তারা তাদের কোডবেসের পঠনযোগ্যতা বাড়াতেও সক্ষম হয়েছিল, যা কোম্পানির ক্রমাগত বৃদ্ধির সাথে সাথে তাদের কোড বজায় রাখা সহজ করে তুলেছে।
ফলাফল
কোটলিনে লেখা তাদের সামগ্রিক উত্পাদনশীলতা বাস্তবায়ন থেকে শুরু পর্যন্ত উন্নত করেছে । তারা যে সবথেকে বড় উন্নতি দেখেছে তা হল কোটলিনে লেখা তাদের কোডের রূপান্তরিত লাইন 20% কমিয়ে দিয়েছে । স্মার্টনিউজ অ্যাপের প্রায় অর্ধেক বর্তমানে কোটলিনে রয়েছে এবং ডেভেলপমেন্ট টিম কোটলিনে সমস্ত নতুন বৈশিষ্ট্য লেখার পাশাপাশি তাদের কোড রক্ষণাবেক্ষণযোগ্যতা বাড়ানোর জন্য তাদের বিদ্যমান কোডগুলির কিছু রিফ্যাক্টর করার পরিকল্পনা করেছে।
যখন ডেভেলপমেন্ট টিম কোটলিন বাস্তবায়ন করছিল এবং বয়লারপ্লেট কোড হ্রাস করছিল, তারা দলের মনোবলের বৃদ্ধি লক্ষ্য করেছে। দলটি তাদের ধারণাগুলিকে আরও দক্ষ উপায়ে প্রকাশ করতে পেরে এবং তাদের কোড ভবিষ্যতের জন্য আরও পাঠযোগ্য হতে পেরে উত্তেজিত ছিল৷ Hideo Ohashi, SmartNews এর ইঞ্জিনিয়ারিং ম্যানেজার লক্ষ্য করেছেন Kotlin তাদের ইঞ্জিনিয়ারিং নিয়োগের প্রচেষ্টায় সাহায্য করেছে ৷ "প্রার্থীদের কাছ থেকে সবচেয়ে ঘন ঘন প্রশ্ন হল 'আপনি কি কোটলিন ব্যবহার করছেন? আপনি কত ঘন ঘন এটা ব্যবহার করবেন?' এখন মনে হচ্ছে অনেক প্রকৌশলী কোটলিনে স্থানান্তরিত হতে আগ্রহী এবং এটিকে সমর্থন করতে চান।" যদিও দলের মনোবল এবং নিয়োগের এই উন্নতিগুলি টিম কোটলিনকে গ্রহণ করার প্রধান কারণ ছিল না, এই ইতিবাচক পরিবর্তনগুলি কোম্পানিকে সাহায্য করবে কারণ এটি এই প্রতিযোগিতামূলক শিল্পে ক্রমাগত বৃদ্ধি পাচ্ছে।
এবার শুরু করা যাক
Kotlin-এর সাথে একটি Android অ্যাপ তৈরি করার বিষয়ে আরও জানুন।
এই পৃষ্ঠার কন্টেন্ট ও কোডের নমুনাগুলি Content License-এ বর্ণিত লাইসেন্সের অধীনস্থ। Java এবং OpenJDK হল 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)."]]