Compose Compiler Metricsを使った実践的なコードレビュー

Sponsored · Your Podcast. Everywhere. Effortlessly. Share. Educate. Inspire. Entertain. You do you. We'll handle the rest. →

Compose Compiler Metricsを使った実践的なコードレビュー

Tomoki Yamashita

April 18, 2024

Annual Pro sale · Save $30

Have presentations of your own?

Share with private links, password protection, and more control over your work.

Transcript

31 slides
  1. 引数が安定している? • 型や変数の宣言方法で判別できる • Stable ◦ Int, Boolean, String… ◦

    Array ◦ イミュータブル(val)で宣言されているプロパティだけで構成されたオブジェクト • Unstable ◦ List, Date… ◦ ミュータブル(var)で宣言されているプロパティを持つオブジェクト 9
  2. Quiz: どれが Unstable でしょうか 11 data class Registration() { val

    name: String, val age: Int, } data class RegistrationRequest( val data: Registration, val tokens: List<String>, ) data class RegistrationResponse( val data: Registration, val error: Throwable, )
  3. Answer: どれが Unstable でしょうか 12 // Stable data class Registration()

    { val name: String, val age: Int, } // Unstable: List is not stable data class RegistrationRequest( val data: Registration, val tokens: List<String>, ) // Unstable: Throwable is not stable data class RegistrationResponse( val data: Registration, val error: Throwable, )

More Decks by Tomoki Yamashita

Other Decks in Technology