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
Kotlinってこんな言語 #jkug
Search
Taro Nagasawa
July 26, 2013
Programming
2
3.5k
Kotlinってこんな言語 #jkug
Kotlin言語について、その特徴とサードパーティ製ライブラリの簡単な紹介。
Taro Nagasawa
July 26, 2013
Tweet
Share
More Decks by Taro Nagasawa
See All by Taro Nagasawa
Android開発者のための Kotlin Multiplatform入門
ntaro
0
760
Kotlin 最新動向2022 #tfcon #techfeed
ntaro
1
2.3k
#Ubie 狂気の認知施策と選考設計
ntaro
13
13k
UbieにおけるサーバサイドKotlin活用事例
ntaro
1
1.1k
KotlinでSpring 完全理解ガイド #jsug
ntaro
6
3.5k
Kotlinでサーバサイドを始めよう!
ntaro
1
1k
Androidからサーバーサイドまで!プログラミング言語 Kotlinの魅力 #devboost
ntaro
5
2.8k
Kotlin Contracts #m3kt
ntaro
4
4.2k
How_to_Test_Server-side_Kotlin.pdf
ntaro
1
510
Other Decks in Programming
See All in Programming
Introducing ReActionView: A new ActionView-compatible ERB Engine @ Rails World 2025, Amsterdam
marcoroth
0
690
「手軽で便利」に潜む罠。 Popover API を WCAG 2.2の視点で安全に使うには
taitotnk
0
860
Android 16 × Jetpack Composeで縦書きテキストエディタを作ろう / Vertical Text Editor with Compose on Android 16
cc4966
1
220
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
Performance for Conversion! 分散トレーシングでボトルネックを 特定せよ
inetand
0
160
FindyにおけるTakumi活用と脆弱性管理のこれから
rvirus0817
0
510
HTMLの品質ってなんだっけ? “HTMLクライテリア”の設計と実践
unachang113
4
2.9k
Navigating Dependency Injection with Metro
zacsweers
3
260
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
testingを眺める
matumoto
1
140
概念モデル→論理モデルで気をつけていること
sunnyone
2
180
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
150
Featured
See All Featured
Balancing Empowerment & Direction
lara
3
620
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
920
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
4 Signs Your Business is Dying
shpigford
184
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.5k
Visualization
eitanlees
148
16k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
520
Imperfection Machines: The Place of Print at Facebook
scottboms
268
13k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How to Ace a Technical Interview
jacobian
279
23k
Transcript
Kotlinͬͯ͜Μͳݴޠ 2013.7.26 ୈ1ճ͔Θ͍͍Kotlinษڧձ @ngsw_taro
͢͜ͱ •Kotlin is Կ •؆ܿ •҆શ •3rd Party Library/FW
Kotlin is Կ
Better Java
JetBrains͕։ൃ͍ͯ͠Δ ੩తܕ͚ݴޠ for JVM, Android, JavaScript
ΫϥεΦϒδΣΫτ εϚʔτΩϟετ ϥϜμࣜ ߴ֊ؔ null҆શ τϨΠτ ֦ுؔ ܕਪ
Scala͑ʁ
·͔͊֬ʹɻɻ
Kotlinͷઃܭඪ̍ JavaฒͷίϯύΠϧ
Kotlinͷઃܭඪ̎ දݱྗΛҡ࣋ͭͭ͠ ScalaΑΓγϯϓϧʹ
؆ܿ
val hoge: Int = 5.inc() ͯ͢ΦϒδΣΫτ ϓϦϛςΟϒܕͳ͍
҉ͷܕมͳ͍ val a: Float = 2 val b: Float =
2.toFloat() ←NG
ߴ֊ؔ/ϥϜμࣜ (1..999).filter { it % 3 == 0 || it
% 5 == 0 }.reduce { sum, e -> sum + e }
Ϋϥε class Person( val name: String, val age: Int =
20 )
Ϋϥε class Person( val name: String, val age: Int =
20 ) ίϯετϥΫλ ϓϩύςΟ σϑΥϧτ
Πϯελϯεੜ Person(“Taro”, 25) Person(“Taro”) Person(name=“Taro”)
Πϯελϯεੜ Person(“Taro”, 25) Person(“Taro”) Person(name=“Taro”) ύϥϝʔλলུ ໊લҾ newෆཁ
֦ுؔ τϨΠτ ςϯϓϨʔτࣜ ͦͷଞʹ ͳͲͳͲ
҆શ
null҆શ Φʔόϔουͷͳ͍ OptionܕͷΑ͏ͳͷ
val name: String = name() assert(name != null) ඞͣ͋Δ
val name: String? = name() ͕ͳ͍͔
val name: String? = name() val len = name.length ҆શͰͳ͍ͷېࢭ
←NG
val name: String? = name() if(name != null) val len
= name.length ҆શͳͷOK
val name: String? = name() val len = name?.length ʮ҆શݺͼग़͠ʯ
Ωϟετ δΣωϦΫε ͦͷଞʹ
3rd Party Library/FW
Kara Web Framework KotlinݴޠDSLͰϧʔςΟϯά͔ΒϏϡʔ·Ͱ࡞ΕΔ
class IndexView(val task: Task = Task()): HtmlView() { override fun
render(context: ActionContext) { h2("λεΫͷొ") formFor(task, "/task".link(), FormMethod.post) { p { labelFor("title", "໊݅") textFieldFor("title") } p { labelFor("content", "༰") textAreaFor("content") } p { input(inputType = InputType.submit, value = "ొ") } } } }
Spek ಡΈ͍༷͢Λهड़͢ΔͨΊͷDSL
public class calculatorSpecs : JUnitSpec() {{ given("a calculator") { val
calculator = Calculator() on("calling sum with two numbers") { val sum = calculator.sum(2, 4) it("should return the result of adding the first number to the second number") { shouldEqual(6, sum) } } } }} https://github.com/hhariri/spekΑΓҾ༻
Node.kt funKTionale ͦͷଞʹ
͋Γ͕ͱ͏͍͟͝·ͨ͠