Is Kotlin better than Java 8? [ & Kotlin Java Scala 文章集錦]

Java 8 is a mature language and with more developers and a community to support its use in android development with great results and productivity and more developers are used to Java 8.
Kotlin is safe, concise, interoperable, tool friendly and comes with data classes and other useful features below which java 8 does not offer.

“Kotlin has way, way more to offer than Java 8. Here is just a sampling (in no particular order)

Null-safety
Type inference
String interpolation
Data classes
Delegation
Smart casts
Conditionals as expressions
Sealed classes
The when expression
Extension functions
Co-routines in 1.1

... and I'm sure I've just scratched the surface”-What if the future of Kotlin when/if Java 8 becomes available on Android? ? r/Kotlin

How will Java 8 impact Kotlin?
“Comparison to Java Programming Language
Some Java issues addressed in Kotlin
Kotlin fixes a series of issues that Java suffers from
Null references are controlled by the type system.
No raw types
Arrays in Kotlin are invariant
Kotlin has proper function types, as opposed to Java's SAM-conversions
Use-site variance
without wildcards

Kotlin does not have checked exceptions

What Java has that Kotlin does not
Checked exceptions
Primitive types that are not classes
Static members
Non-private fields
Wildcard-types

What Kotlin has that Java does not
Lambda expressions+Inline functions = performant custom control structures
Extension functions
Null-safety
Smart casts
String templates
Properties
Primary constructors
First-class delegation
Type inference for variable and property types
Singletons
Declaration-site variance & Type projections
Range expressions
Operator overloading
Companion objects
Data classes
Separate interfaces for read-only and mutable collections
Coroutines

Comparison to Java - Kotlin Programming Language

footnotes:
Kotlin vs. Java: First Impressions Using Kotlin | ArcTouch
Java vs. Kotlin: Should You Be Using Kotlin for Android Development?
10 Features I Wish Java Would Steal From the Kotlin Language
Java vs. Kotlin: First Impressions Using Kotlin for a Commercial Android Project - DZone Mobile
Java 8 vs Kotlin
Does Kotlin have better functional programming support than Java 8 streams and lambdas?
Functional programming in Java 8, Kotlin and Scala
Java vs. Kotlin: Android Programming Languages
What are the advantages of Kotlin over Java?
Kotlin vs Java: key differences between Android's officially-supported languages
Kotlin Programming Language

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,817評(píng)論 0 10
  • 由于經(jīng)常出差的緣故,高鐵動(dòng)車坐了很多次,一直以來都是匆匆忙忙,這次難得有時(shí)間可以好好觀察下高鐵產(chǎn)站以及高鐵上德一些...
    汪繼志閱讀 692評(píng)論 0 0
  • 看完白樺太太的《未完成的肖像》之后,就想寫一首戰(zhàn)爭中的平凡x 我很喜歡太太對(duì)露西亞那段深夜掙扎反思的地方。戰(zhàn)士也會(huì)...
    袖間長寄風(fēng)與月閱讀 322評(píng)論 0 0

友情鏈接更多精彩內(nèi)容