본문 바로가기

728x90
반응형

Kotlin

12/28 read post 1. 출처 : https://medium.com/swlh/kotlin-dilemma-extension-or-member-38912d4c0989 제목 : Kotlin dilemma: Extension or Member 요약 : kotlin extention function 은 매우 훌륭한 기능이지만, 이것을 남용하게 되면 코드의 부실성을 가져오기 때문에 오히려 좋지 못한 예를 설명합니다. 그리고 적절히 사용해야 될 때를 설명합니다. 더보기
12/12 read post 1. 출처 : https://medium.com/@ankit.sinhal/kotlin-lazy-vs-lateinit-properties-when-to-use-which-property-97173c2e55ff 제목 : Kotlin Lazy vs Lateinit Properties. When to use which property? 요약 : kotlin 의 lazy 와 lateinit 을 비교하며 언제 사용하는지에 대해서 가볍게 설명하고 있다. 더보기
10/3 read post 1. 출처 : Suspending Lambdas in Kotlin 제목 : Suspending Lambdas in Kotlin 요약 : 코루틴에서 서스펜드 키워드에 대해서 간략히 설명하고 람다를 return 하는 형식을 서스펜드와 어떻게 조합하는지에 대해서 설명합니다. return type 을 (suspend () → File) 로 할 수도 있지만 return type 을 suspend { … } 로 할 수도 있습니다. 2. 출처 : Effective extension function refactoring in Kotlin: companion object use case 제목 : Effective extension function refactoring in Kotlin: companion object u.. 더보기
Avoid Using “when” Expression as Much as Possible. Use Polymorphism Instead 출처 : https://medium.com/better-programming/avoid-using-when-expression-as-much-as-possible-use-polymorphism-instead-890b92389060 When 문은 종종 smell code 로 간주되어 피해야만 합니다. 5개의 미리 정의된 크기로 개발해야 하는 Button 5개가 있다고 가정해 보겠습니다. small (height = 16dp) medium (height = 24dp) large (height = 32dp) huge (height = 40dp) custom sealed class ButtonSize { object Small : ButtonSize() object Medium : ButtonSize() obj.. 더보기

728x90
반응형