Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Scala vs. Kotlin; Friend or Foe?
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
oshai
July 02, 2018
Programming
180
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Scala vs. Kotlin; Friend or Foe?
Talk in scalapeno 2018
oshai
July 02, 2018
Transcript
37 slides
None
None
None
None
Conflicts
Threats • Identify • Compete • Conquer https://www.americanlearninglibrary.com/search/C/caesar/caesar.html
https://ja.wikipedia.org/wiki/%E3%82%B9%E3%83%86%E3%82%A3%E3%83%B3%E3%82%AC%E3%83%BC%E3%83%9F%E3%82%B5%E3%82%A4%E3%83%AB
What is Kotlin • Statically typed • Multi-Platform (JVM first,
JS and Native) • Open Source by JetBrains https://medium.com/@octskyward/why-kotlin-is-my-next-programming-language-c25c001e26e3
Kotlin Features • Concise
Kotlin Features • Concise • Safe
Kotlin Features • Concise • Safe • Interoperable
Kotlin Features • Concise • Safe • Interoperable • Tool-friendly
Kotlin Features • Concise • Safe • Interoperable • Tool-friendly
• Fun
Side by side comparison Scala val hello: String = “hi"
var hello: String = "hi" Kotlin val hello: String = “hi" var hello: String = "hi"
Side by side comparison Scala val hello = “hi" var
hello = "hi" Kotlin val hello = “hi" var hello = "hi"
Case / data class Scala case class Service( name: String
) Kotlin data class Service( val name: String )
Null safety Scala var hello: Option[String] = None hello.foreach {
s => println(s.toUpperCase()) } println(hello.map( _.toUpperCase()) .orNull()) Kotlin var hello: String? = null println(world.toUpperCase()) if (world != null) { println(world.toUpperCase()) } println(world?.toUpperCase())
Singleton Scala object Single { } Kotlin object Single {
}
Enum Scala Coming soon… Kotlin enum class Fruits { Apple,
Banana }
Implicit class / Extension method Scala 5.hours() Kotlin 5.hours()
Implicit class / Extension method Scala object Helpers { implicit
class IntMillis(x: Int) { def hours() = TimeUnit.HOURS.toMillis(x) } } … 5.hours() Kotlin fun Int.hours() = TimeUnit.HOURS.toMillis( this.toLong()) … 5.hours()
Operator overloading Scala It’s actually methods with fancy names Kotlin
Limited to arithmetic operators + - \ * etc’
Pattern matching Scala Cool and Useful! Kotlin Very limited
Implicit conversion Scala Yes we can! Kotlin no no no!
Where Scala shines • Popularity • Evangelism https://www.cvm.org.uk/blog/demolition-squad/eight-evangelism-strategies/
Where Scala shines https://redmonk.com/sogrady/2018/03/07/language-rankings-1-18/
Where Kotlin shines • Java++ - hit the sweet spot
• Great Java inter-op • Lean • Tooling • Pragmatic - not reinventing the wheel
• Compete http://www.zimbio.com/photos/Mesut+Oezil/Germany+v+Argentina/xxHxKC8AyXD
Suggestions for Scala designers • Let’s be practical:
Suggestions for Scala designers • Let’s be practical: • Binary
compatibility https://stackoverflow.com/questions/32255023/how-would-i-go-about-parsing-the-java-class-file-constant-pool
Suggestions for Scala designers • Let’s be practical: • Binary
compatibility • Faster compilation http://www.doodleosophies.com/doodle/30
Suggestions for Scala designers • Let’s be practical: • Binary
compatibility • Faster compilation • Improve Java inter-op
Suggestions for Scala users • Stick to features exists in
Kotlin
Suggestions for Scala users • Stick to features exists in
Kotlin • Make your code readable by all team members
Suggestions for Scala users Move to Kotlin…
Question?
Thank You! @OhadShai
More Decks by oshai
See All by oshai
Maintaining an Open Source The Good, Bad & Ugly
oshai
0
39
KScript
oshai
0
26
Klean Code with Kotlin
oshai
0
84
JVM languages shootout - Java, Scala & *Kotlin*
oshai
0
71
Koroutinify ; Lessons learned from applying Coroutines in Kotlin Backend ; Deep dive into Coroutines
oshai
1
140
Klean that Code, Boil those Boilerplates
oshai
2
100
No forks, One star. Now what?! — How I published my Kotlin Open-Source lib
oshai
0
92
Scala--pack your Future[T]; Kotlin is coming! (Kotlin TLV)
oshai
0
210
X tips [X==9] for building a Bulletproof Deployment Pipeline with Jenkins
oshai
0
72
Other Decks in Programming
See All in Programming
Web Framework Benchmark Battle 2026, Any%
a_matsuda
3
3.2k
flutter_test のその先へ — Flutter アプリの LLM 機能に「評価」という品質保証を
kosukesaigusa
0
200
AIが生成したコードは読むべきか?抽象化設計とコードの品質保証 / abstraction-design-and-quality
minodriven
16
9.1k
AIが実装を担う時代の「技術設計」と「チームマネジメント」
kamina_zzz
2
260
小さなアプリを作って公開するまで
onozaty
0
170
LLM 101
dalinaum
0
490
例外からRich Errorsまで Kotlinエラーハンドリングの進化を読み解く
shiita0903
0
130
Spec-Driven Development - Why Vaadin Is the Perfect Fit
simas
PRO
0
250
Secure Your Coding Agent Like It’s Malware (v1.5) 🇬🇧 @Code.talks 2026
richargh
0
150
Getting Started with Vibe Coding
miccheng
0
220
ビジネスロジックを堅牢に~Scala 3のドメインプリミティブ~
j5ik2o
0
160
AI時代のFlutter品質設計 — アプリ品質を守るQuality Layers
omatty198
0
380
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Winning Strategies for Black Friday CRO & PPC - Christian Goodrich
cargoodrich
3
900
Building a Scalable Design System with Sketch
lauravandoore
464
34k
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
Unsuck your backbone
ammeep
672
58k
The SEO Collaboration Effect
kristinabergwall1
1
620
Marketing to machines
jonoalderson
1
6k
<Decoding/> the Language of Devs - We Love SEO 2024
nikkihalliwell
1
380
Agile that works and the tools we love
rasmusluckow
331
22k
Code Reviewing Like a Champion
maltzj
529
40k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
20k
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
56
3.5k
Testing 201, or: Great Expectations
jmmastey
46
8.4k