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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Taro Nagasawa
July 26, 2013
Programming
3.6k
2
Share
Kotlinってこんな言語 #jkug
Kotlin言語について、その特徴とサードパーティ製ライブラリの簡単な紹介。
Taro Nagasawa
July 26, 2013
More Decks by Taro Nagasawa
See All by Taro Nagasawa
Android開発者のための Kotlin Multiplatform入門
ntaro
0
1.6k
Kotlin 最新動向2022 #tfcon #techfeed
ntaro
1
2.4k
#Ubie 狂気の認知施策と選考設計
ntaro
13
14k
UbieにおけるサーバサイドKotlin活用事例
ntaro
1
1.2k
KotlinでSpring 完全理解ガイド #jsug
ntaro
6
3.6k
Kotlinでサーバサイドを始めよう!
ntaro
1
1k
Androidからサーバーサイドまで!プログラミング言語 Kotlinの魅力 #devboost
ntaro
5
3k
Kotlin Contracts #m3kt
ntaro
4
4.4k
How_to_Test_Server-side_Kotlin.pdf
ntaro
1
560
Other Decks in Programming
See All in Programming
過去のレビュー知見をSkillsで資産化した話
pkshadeck
PRO
1
2k
Import assertionsが消えた日~ECMAScriptの仕様はどう決まり、なぜ覆るのか~
bicstone
2
190
Stage 3 Decorators でできること / できないこと / TSKaigi 2026
susisu
0
130
【ディップ|26年新卒研修資料】TDD実装演習
dip_tech
PRO
0
190
AgentCore Optimizationを始めよう!
licux
3
260
Agentic Elixir
whatyouhide
0
450
TypeSpec で繋ぐ複数プロダクトの型安全
maroon8021
1
110
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
3
420
サプライチェーン攻撃対策「層を重ねて落ちない壁」を10日間で組み上げた話 #TechLeadConf2026
kashewnuts
1
290
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
150
🦞OpenClaw works with AWS
licux
1
370
AI時代のエンジニアリングの原則 / Engineering Principles in the AI Era
haru860
0
1.3k
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
35k
Game over? The fight for quality and originality in the time of robots
wayneb77
1
170
Technical Leadership for Architectural Decision Making
baasie
3
370
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.9k
Fight the Zombie Pattern Library - RWD Summit 2016
marcelosomers
234
17k
Fashionably flexible responsive web design (full day workshop)
malarkey
408
66k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
How STYLIGHT went responsive
nonsquared
100
6.1k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
61
44k
A Modern Web Designer's Workflow
chriscoyier
698
190k
Building the Perfect Custom Keyboard
takai
2
770
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
550
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 ͦͷଞʹ
͋Γ͕ͱ͏͍͟͝·ͨ͠