Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
SOUZOUxMERCARI-A Story of Cute Birds and Oldman
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
jsugai
November 24, 2017
670
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SOUZOUxMERCARI-A Story of Cute Birds and Oldman
jsugai
November 24, 2017
More Decks by jsugai
See All by jsugai
OsakaMixLeap #11 LT "Star Trek" and "Software development" are similar
jsugai
0
400
Swift <-> Kotlin
jsugai
0
490
Prepare for Android 8.0/GDG-Kobe 2017-09-18
jsugai
0
83
Hashtag
jsugai
1
630
Layout ファイルののメンテナンス
jsugai
1
530
Ho Chi Minh.apk
jsugai
0
53
Umeda.apk 報告会資料
jsugai
1
570
Featured
See All Featured
Designing for Timeless Needs
cassininazir
1
470
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Leading Effective Engineering Teams in the AI Era
addyosmani
9
2.5k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
470
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
920
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
260
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Transcript
͔Θ͍͍খௗΛғ͏ ͓ͬ͞Μୡͷ Mercari, Inc
About me Jun Sugai @calciolife Mercari
Agenda • Welcome Kotlin • Kotlinizing • using Kotlin
Welcome
None
Ͳ͏͍͏ܦҢͰ? Welcome Kotlin/Kotlin ಋೖ
ָͦ͠͏ͳงғؾ͋ͬͨ Welcome Kotlin/Kotlin ಋೖ
•ָͦ͠͏ͳΒͬͯ͠·͏ •໘നͦ͏ͳͬͯ͠·͏ •͕ͳ͚Εڋ൱͠ͳ͍ Welcome Kotlin/Kotlin ಋೖ
Kotlinizing
•ςετίʔυ •Өڹͷগͳ͍ͱ͜Ζ͔Β •৽نͷػೳ͔Β •etc... ABC
•ςετίʔυ •Өڹͷগͳ͍ͱ͜Ζ͔Β •৽نͷػೳ͔Β •etc... ABC શ෦Ͱ͢ΑͶ
ಋೖͬͯײΛॻ͘·ͰΔ ݁ՌΛग़ͯͦ͜͠Ռ ΠλϦΞදͩͬͯϘίϘί
using Kotlin
είʔϓؔ Kotlin ͕Α΄Ͳಛघͳ࣮/࠷దԽͰ ͳ͍ݶΓείʔϓؔཁ͢Δʹ ϝιουΛ࡞ͬͯॲཧΛҠ͔͑͠Δ ίʔυʹࠩ͠ସ͑Δ
None
είʔϓؔ ͏͖ɻReadable ͬͯେࣄɻ
var/val/collection ΞΫηε੍ޚΧϓηϧԽͳͲ Java ΑΓ͔Γ͍͢໘ɺ ଟ༻͢͠͞Ͳ͏ͳΜͩΖ͏?
var/val/collection public class SearchListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private val List<SearchKeyWord>
dataSet = new ArrayList<>(); public SearchListAdapter(SearchListener listener) { this.listener = listener; } //... @Override public int getItemCount() { return dataSet.size(); } public void setDataSet(List<SearchKeyWord> dataSet) { this.dataSet = dataSet; notifyDataSetChanged(); }
var/val/collection public class SearchListAdapter extends RecyclerView.Adapter<RecyclerView.ViewHolder> { private val List<SearchKeyWord>
dataSet = new ArrayList<SearchKeyWord>() //େࣄͳͱ͜Ζ͚ͩ public void setDataSet(List<SearchKeyWord> dataSet) { this.dataSet.clear() this.dataSet.addAll(dataSet) notifyDataSetChanged(); } // Kotlin ͩͱ immutable ʹͨ͘͠ͳͬͪΌ͏
None
var/val/collection private val List<SearchKeyWord> dataSet = new ArrayList<SearchKeyWord>() //େࣄͳͱ͜Ζ͚ͩ public
void setDataSet(List<SearchKeyWord> dataSet) { this.dataSet.clear() this.dataSet.addAll(dataSet) notifyDataSetChanged(); } •clear() -> addAll() ͷྲྀΕ GC ίετతʹͲ͏ͳͷ? •addAll() ͰՃ͢Δࡍͷཁૉ͕ڊେͳ instance ڊେͳ heap ͷࢀরΛอ࣋͢Δߏͩͱ clear() -> adAll() ͚ͩͰ GC ͕ΔՄೳੑ? •ཁૉͷίϐʔΛ࡞Δ heap ίετ/ϑοτϓϦϯτॲཧશମͰແࢹͰ͖Δ΄Ͳখ͍͞?
var/val έʔεʹԠͯ͡ Readable ͳͷେࣄ͚ͩͲϦιʔε༗ݶɻ ύϑΥʔϚϯε "ίʔυͷ࣭" Ͱͳ͘ "ΞϓϦͷ࣭" ͳͷͰಉ͡؍Ͱٞ͠ͳ͍ɻ
ଞͷࣄྫɺ·ͨผͷػձʹ! ใަͱ͔͍ͯͩ͘͠͞