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
Scala vs. Kotlin; Friend or Foe?
Search
oshai
July 02, 2018
Programming
170
0
Share
Scala vs. Kotlin; Friend or Foe?
Talk in scalapeno 2018
oshai
July 02, 2018
More Decks by oshai
See All by oshai
Maintaining an Open Source The Good, Bad & Ugly
oshai
0
37
KScript
oshai
0
21
Klean Code with Kotlin
oshai
0
72
JVM languages shootout - Java, Scala & *Kotlin*
oshai
0
52
Koroutinify ; Lessons learned from applying Coroutines in Kotlin Backend ; Deep dive into Coroutines
oshai
1
120
Klean that Code, Boil those Boilerplates
oshai
2
88
No forks, One star. Now what?! — How I published my Kotlin Open-Source lib
oshai
0
79
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
52
Other Decks in Programming
See All in Programming
PHPでバイナリをパースして理解するASN.1
muno92
PRO
0
460
ソフトウェア設計の結合バランス #phperkaigi
kajitack
0
510
Are We Really Coding 10× Faster with AI?
kohzas
0
180
KMP × Kotlin 2.3 - How Android Got Slower While iOS Builds Improved by 47%
rio432
0
200
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.7k
Agentic UI in the Frontend: Architectures with Open Standards @JAX 2026 in Mainz
manfredsteyer
PRO
0
120
AI時代になぜ書くのか
mutsumix
0
410
Hive Metastoreを通して学ぶIceberg REST Catalog ― 仕様から実装まで
okumin
0
140
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
150
From Formal Specification to Property Based Test
ohbarye
0
2.6k
Lightning-Fast Method Calls with Ruby 4.1 ZJIT / RubyKaigi 2026
k0kubun
3
3.1k
【ディップ|26年新卒研修資料】OpenAPI/Swagger REST API研修
dip_tech
PRO
0
170
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
10k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
2
810
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
110
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1.3k
Taking LLMs out of the black box: A practical guide to human-in-the-loop distillation
inesmontani
PRO
3
2.2k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
46
2.8k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
1
350
Designing Experiences People Love
moore
143
24k
The Language of Interfaces
destraynor
162
26k
Evolving SEO for Evolving Search Engines
ryanjones
0
190
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
55k
Transcript
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