توییتر بهره وری توسعه دهندگان و قابلیت اطمینان کد را با Kotlin افزایش می دهد
با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.

توییتر یکی از پرکاربردترین پلتفرمهای رسانههای اجتماعی است که در آن کاربران میتوانند در هر لحظه اتفاقات جهان را ببینند. تیم مهندسی، Kotlin را در سال 2017 با هدف نگهداری بیشتر پایگاه کد و قابل اعتمادتر کردن برنامه اندروید خود در نتیجه ویژگیهای ایمنی پوچ Kotlin معرفی کرد.
کاری که آنها انجام دادند
این تیم ابتدا کاتلین را به پایگاه کد Periscope و ویژگی Periscope اپلیکیشن توییتر معرفی کرد و توانست مزایا و معاوضه استفاده از Kotlin را آزمایش کند. آنها تحت تأثیر پیشرفت های بهره وری و قابلیت اطمینان کد، به تدریج شروع به اضافه کردن Kotlin به سایر ویژگی های برنامه توییتر کردند.
کاتلین به توییتر کمک کرده تا میزان کد موجود در اپلیکیشن خود را کاهش دهد، تعمیر و نگهداری دیگ بخار را به حداقل رسانده و تیم را قادر می سازد تا بهره وری بیشتری داشته باشد. آنها از ویژگیهای زبانی مانند کلاسهای داده، کلاسهای مهر و موم شده و پارامترهای پیشفرض استفاده کردند که به آنها امکان میداد کد کمتر و سریعتر بنویسند. ریخته گری هوشمند کاتلین همچنین میزان کدهایی را که تیم آنها برای نوشتن و نگهداری نیاز دارد کاهش داده است.
استفاده از کاتلین لذت بخش است. کاهش دیگ بخار، مقدار کدی را که باید بنویسیم کاهش میدهد.» - اندی فاکس، مهندس ارشد نرم افزار در توییتر
ویژگیهای ایمنی پوچ کاتلین نیز قابلیت اطمینان کد توییتر را افزایش داده است. در ابتدا زمانی که تیم کاتلین را معرفی کرد، شکستهای بیصدا را کشف کردند که قبلاً کشف نشده بودند. بررسی تهی زمان کامپایل به تیم اجازه می دهد تا مشکلات را زودتر تشخیص دهد و خطاهای پوچ پذیری را فعالانه تر مدیریت کند.
نتایج
پس از پذیرش Kotlin، تیم همچنان شاهد سلامت و عملکرد عالی سیستم برای برنامه خود بوده است. در همان زمان، آنها بهره وری تیم خود را بهبود بخشیده اند و برنامه خود را با گرفتن خطاهای مهم در زمان کامپایل به جای زمان اجرا، ایمن تر کرده اند. با افزایش بهره وری و قابلیت اطمینان کد، تیم تصمیم گرفته است که بسیاری از ویژگی های جدید مانند Fleets، DM Reactions و Lists را در Kotlin بنویسد.
شروع کنید
درباره توسعه برنامه Android با Kotlin بیشتر بیاموزید.
محتوا و نمونه کدها در این صفحه مشمول پروانههای توصیفشده در پروانه محتوا هستند. جاوا و OpenJDK علامتهای تجاری یا علامتهای تجاری ثبتشده Oracle و/یا وابستههای آن هستند.
تاریخ آخرین بهروزرسانی 2020-10-21 بهوقت ساعت هماهنگ جهانی.
[[["درک آسان","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"]],["تاریخ آخرین بهروزرسانی 2020-10-21 بهوقت ساعت هماهنگ جهانی."],[],[],null,["# Twitter increases developer productivity and code reliability with Kotlin\n\n[Twitter](https://play.google.com/store/apps/details?id=com.twitter.android&hl=en)\nis one of the most widely used social media platforms where users can see what's\nhappening in the world at any given moment.\nThe engineering team introduced Kotlin in 2017 with the goal of making their\ncodebase more maintainable and their Android app more reliable as a result of\nKotlin's [null safety features](/kotlin/common-patterns#nullability).\n\nWhat they did\n-------------\n\nThe team initially introduced Kotlin into [Periscope](https://play.google.com/store/apps/details?id=tv.periscope.android&referrer)'s\ncodebase and into the Periscope feature of the Twitter app, and were able to\ntest the benefits and tradeoffs of using Kotlin. Impressed with the improvements\nto productivity and code reliability, they gradually began adding Kotlin to\nother features of the Twitter app.\n\nKotlin has helped Twitter decrease the amount of code in their app,\nminimizing boilerplate maintenance and **enabling the team to be more\nproductive.** They used language features such as data classes, sealed\nclasses, and default parameters, which allowed them to be able to write less\ncode, and faster. Kotlin's smart casting has also reduced the amount of code\ntheir team needs to write and maintain.\n\n*\"Kotlin is a joy to use. The reduction in boilerplate reduces the amount of\ncode we need to write.\" - Andy Fox, Senior Software Engineer at Twitter*\n\nKotlin's null safety features have also increased Twitter's code reliability.\nInitially when the team introduced Kotlin, they uncovered silent failures that\nhad previously gone undetected. Compile time null checking allows the team to\n**detect issues sooner, and handle nullability errors more\nproactively.**\n\nResults\n-------\n\nAfter adopting Kotlin, the team has continued to see excellent system health\nand performance for their app. At the same time, they've improved their team's\nproductivity and made their app safer by catching critical errors at compile\ntime instead of runtime. With the increases in productivity and code\nreliability, the team has decided to write many new features such as Fleets,\nDM Reactions, and Lists in Kotlin.\n\nGet started\n-----------\n\nLearn more about [developing an Android app with Kotlin](/kotlin)."]]