如果我们静态编译Groovy,Kotlin和Groovy看起来是非常相似的语言,具有非常相似的特性.除了空安全性,Kotlin还有哪些功能是Groovy中缺少的?
如果我们静态编译Groovy,Kotlin和Groovy看起来是非常相似的语言,具有非常相似的特性.除了空安全性,Kotlin还有哪些功能是Groovy中缺少的?
Kotlin is a JVM language, which IMO is trying to improve on Java in features and conciseness, while remaining imperative and static. Groovy has a similar concept except decided to go dynamic. As a result, a number of language features will be similar.
以下是我意识到的一些差异
There are a number of other features that is has though. I'd recommend you look at the reference, and you may spot a few more e.g. https://kotlinlang.org/docs/reference/
如您所见,它确实borrow 了Groovy以外的其他语言.他们试图精挑细选一些伟大的特征,以期创造出一门好的语言.当然,Groovy也有自己的优点.我只专注于柯特林有的东西,而不是签证-反之亦然
Another plus is, being made by an IDE maker, the compiler is very quick and has great IDE support. Not saying Groovy does not have good support, but my current project does take a long time to compile, and refactor method always assumes you are coding in a dynamic fashion.
我建议您try 一下Koan,让他们了解您喜欢该语言的哪些特性,以及它与groovy(https://github.com/Kotlin/kotlin-koans)的比较.