stdlibのスタンス Kotlin言語の標準ライブラリ方針 (v1.0リリースノートより) “Kotlin has an extensive standard library that makes everyday tasks easy and smooth while keeping the bytecode footprint low.” ≒ 日常的な(頻出の)コードを簡単に書けるが、バイトコードを小さく
(v1.0リリースノートより) For us, pragmatism is about creating a user experience, not a language or a library alone. Many of the language design decisions were made under constraints like “Won’t this impede incremental compilation?”, “What if this increases APK method counts?”, “How will the IDE highlight this as you type?” ≒ 開発者体験や制約(Androidのメソッド数64K上限)をもとに言語設計する
data class User(val id: Int, val name: String) val user = User(1, "John") !/ JSON val jsonEncoder = Json() val encoded = jsonEncoder.encodeToString(user) !/ {"id": 1, "name": "John"} !/ PHP val phpEncoeder = PHP() val encoded = phpEncoeder.encodeToString(user) !/ "O:4:\"User\":2:{s:2:\"id\";i:100;s:4:\"name\";s:4:\"John\";}"