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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi阅读 7,499评论 0 10
  • 由于经常出差的缘故,高铁动车坐了很多次,一直以来都是匆匆忙忙,这次难得有时间可以好好观察下高铁产站以及高铁上德一些...
    汪继志阅读 658评论 0 0
  • 看完白桦太太的《未完成的肖像》之后,就想写一首战争中的平凡x 我很喜欢太太对露西亚那段深夜挣扎反思的地方。战士也会...
    袖间长寄风与月阅读 297评论 0 0