Live data from Hacker News

Why Kotlin is my next programming language (2015)

medium.com

61–70 of 185 posts

Re: Why Kotlin is my next programming language (2015)

#61
For me Kotlin is almost a perfect replacement for Java. It has very few drawbacks, but generally it's much better and it's a pleasure to use it. Not to mention solid IDE support. I've used Kotlin in two small projects. One project was completed year ago and now I'm improving it. Kotlin is just awesome when it comes to refactoring or generalising. Much better than Java.

I don't want to compare it to Scala, they target different auditories, IMO. I tried Scala, it's a lovely language, but it's too complex. I had to spend a month before I was able to write a quality code using Scala and I still had a lot of problems reading scala collections source code or even understand scalaz. On the other side I spent one evening reading about Kotlin (awesome and very complete, yet small documentation definitely helps) and I knew the language, could read its standard library and write production-quality code. For me that's a deal breaker.

Re: Why Kotlin is my next programming language (2015)

#62

> Kotlin comes from industry, not academia. It solves problems faced by working programmers today. As an example, the type system helps you avoid null pointer exceptions. I'm sorry but you just undercut your own anti-intellectualism better than I could right there. (There exist languages which have guarded against this without loss of expressive power since before Java and, oh, are from academia.)

A better example of 'engineering not academy' would be explicit vectorization, memory layout support and a good FFI. (all the stuff that in theory is better managed by compilers, in practice it either doesn't matter at all or else should be left to humans).

Please correct me if I'm wrong, but Kotlin doesn't improve on Java in these areas.

Re: Why Kotlin is my next programming language (2015)

#63
post #44
post #40

What happened to Scala? Wasn't that the #1 language for JVM?

Scala is still there, still growing, and a much better language. Kotlin is founded on this anti-intellectual rejection of Scala's advanced features... only to then add them back in piecemeal. So rather than a single powerful general feature like implicits or higher-kinded types you have language-level special cases like extension methods and specific nullness operators. (Don't get me wrong, there are plenty of things…

Anti-intellectual? More like complexity, let's be honest about motives here: it isn't "we hate types" it is "I have no idea what is going on here anymore." The "start over again and try do it right this time" is quite pervasive in PL, and even if it keeps on leading to the same problem, the motivation is always well meaning.

Re: Why Kotlin is my next programming language (2015)

#64

> Kotlin comes from industry, not academia. It solves problems faced by working programmers today. As an example, the type system helps you avoid null pointer exceptions. I'm sorry but you just undercut your own anti-intellectualism better than I could right there. (There exist languages which have guarded against this without loss of expressive power since before Java and, oh, are from academia.)

Indeed this is more an aspect inspired by academia

the point would have been better made by pointing out the excellent and extensive tooling built by jetbrains for kotlin. that's something the maker of the intellij platform has more experience with than academics

Also there is a tradeoff between advanced language features and good tooling, which is why you will sometimes miss the former inside kotlin

Re: Why Kotlin is my next programming language (2015)

#67

Earlier quoted context omitted.

Tests that verify the behavior of functions when they are passed data of a type that does not support the behavior that the function expects to be supported. I find this to be a very common case.

I address this problem by checking the type at run-time via an assertion. Depending on where you are in the security vs efficiency spectrum, you may opt to ignore those assertions in production. Writing specific tests for that looks very inefficient to me but maybe I am missing something.

I don't see how this reduces the need for a test that the wrong type is handled correctly.

Re: Why Kotlin is my next programming language (2015)

#68
post #10

Earlier quoted context omitted.

Static typing.

Is the reasoning that you then don't have to test what happens if you pass a parameter of the wrong type to a function?

The compiler guarantees it won't happen. Such a test would be a test of the compiler and in my opinion unnecessary. And in Haskell at least... impossible. You can't write the the test because IT won't compile!

Re: Why Kotlin is my next programming language (2015)

#69
post #44
post #40

What happened to Scala? Wasn't that the #1 language for JVM?

Scala is still there, still growing, and a much better language. Kotlin is founded on this anti-intellectual rejection of Scala's advanced features... only to then add them back in piecemeal. So rather than a single powerful general feature like implicits or higher-kinded types you have language-level special cases like extension methods and specific nullness operators. (Don't get me wrong, there are plenty of things…

> Scala is still there, still growing, and a much better language. Kotlin is founded on this anti-intellectual rejection of Scala's advanced features...

Each time someone brings up Scala there comes this weird "people who don't like it are anti-intellectual" - well no, people don't like it because it looks weird, had for the longest time abyssimal IDE support, tries to do things which have been solved in production by itself (see SBT vs Maven) and is a mishmash of more or less every idea that was floating around mixed into one language.

Kotlin has a very specific focus: Being usable for a working Java programmer, who doesn't have three years to learn every weird idea Scala tries to shove down your throat. It uses existing tools, existing Java collections and enhances them instead of saying "well, we do everything new, because we know how to do it 'better' and we don't care for your existing code."

Post reply on HN