4 ms·
Early Impressions of Kotlin
- paulddraper 11y agoThe author's criteria sounds like a brochure for Scala development. > We wanted a typed language. We wanted language aware editing. And we wanted a language that had an organisation behind its development [Typesafe] and enough people using it that we could get questions answered...a more active community, is being used for commercial development by...a number of other companies [Twitter, Foursquare, The Guardian], has good editing support within IntelliJ, has an active community on social media, and promises easy interop with existing Java libraries. Scala also shares most of the "good points" * is interoperable with Java * infers types * has more advanced variance rules * has data classes * has sealed classes * has a mechanism for extension methods * has operator overloading (though Scala operators are syntactic sugar for methods, so arbitrary names are allowed) * has getter and setter syntax And solves many of the "surprises" * destructuring * data classes that can be sealed * better null handling (i.e. Options) * structural typing And of course, Scala has a larger, more mature community, broader support from IDEs and build tools, compile-to-JS abilities (ScalaJS), and many more open source libraries and frameworks. The author mentions that build times are slow. Was compiler performance the singular deal-breaker? I'm not saying I can't think of any downsides of Scala; after three years of full-time development, I've seen a few. (Yep, slow compile times. Also, conceptual complexity. Also anything in the bug tracker. https://issues.scala-lang.org https://issues.scala-lang.org .) But I left the article feeling like Kotlin was a fasting compiling Scala that was less mature and had fewer features. I'd enjoy a fuller perspective on Scala from a Kotlin dev. --- Side note: "Kotlin borrows the concept of companion objects from Scala. Why can’t classes be objects? Perhaps it’s a limitation of the JVM but compared to, say, Python, it feels clunky." I'm guessing this is referring to using compile-time types (classes) as runtime data? I.e. reflection.
- michel-slm 11y agoI'm a dabbler with both Scala and Kotlin, and haven't really used Scala much for the past couple of years, but IMHO Scala's implicit definitions makes it hard to reason about what's going on behind the scenes, and I think Kotlin gets the right balance with its extension methods.
- merb 11y agoThe problem what I see of kotlin is that it tries to be different through naming, but it isn't different. It's a "light" scala. Also IDE support of kotlin is really good through IntelliJ. What I mostly dislike about kotlin is that they tried to have something like ScalaJS but they couldn't really make a "good" version in 1.0