Live data from Hacker News

Why Kotlin is my next programming language (2015)

medium.com

81–90 of 185 posts

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

#81
post #18
post #4

I really liked Scala when I played around with it (bare with me here), but when deciding on what to use on a project I'm starting, targeting the JVM is a downside. Can I depend on the JVM being on the target machine? If not, I'll have to deal with the dependency. However, if I choose a compiled language like Rust, I don't have to worry about that.

Kotlin also compiles to JS then

Did you try it? It's not really usable in its current state.

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

#82
Features: ========= * compiles to Java and Javascript * null safety (optionality) * Lean syntax * Exceptions are unchecked. * Extension functions let you add methods to classes without modifying their source code. * Operator overloading * No macros * Markdown instead of HTML for your API docs * Better Java generics. * Delegation (forwarding methods) * String interpolation

Seriously underwhelming....

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

#83

I see the biggest market for Kotlin being Android. It manages to provide features that Java will likely never have while still having a fairly small impact on run time, deploy, and APK size. The conversion tool is really great too. It makes it much easier to migrate a project to kotlin, especially when trying to figure out more complex stuff like annotations. I see Kotlin being Android's Swift in the future.

I would love to see that happen (or something similar, like Swift).

I fear that it will be hard to move in that direction as long as Google does not push in that direction though.

The official word is that we don't need their support in order to write Android apps in Kotlin, which is true and that the gap between objC and Swift was large enough to justify the change but that Java is not that old, which is debatable.

In all cases, it is hard to argument the move to a new language in an existing codebase when there is no official push in that direction.

If I have to create a new app in the near future, I will strongly consider Kotlin, but for the 8 eight old codebase I have to deal with + the 15 engineers working on it, my hands are tied.

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

#84

> 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.)

The reason they disavow academia is not because there is anything wrong with academia but to make a contrast with their closest competitor, Scala. It's a subtle way of saying "we may look like Scala, because like Scala we are a better Java, but the difference is we are actually useful in the real world. "

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

#85

Features: ========= * compiles to Java and Javascript * null safety (optionality) * Lean syntax * Exceptions are unchecked. * Extension functions let you add methods to classes without modifying their source code. * Operator overloading * No macros * Markdown instead of HTML for your API docs * Better Java generics. * Delegation (forwarding methods) * String interpolation Seriously underwhelming....

It seems like a very pragmatic language, aimed at anything above "systems programming" and not suitable for high-performance (scientific) programming. Not many theoretical advancements in programming language design, if any. Too much of a hodge-podge of features. I would say this language may become interesting only if it gets enough traction from a community.

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

#87

Are there any decent languages that compile to readable Java? I think such a language would have a place in conservative Java shops, where management insists "we only use plain old Java around here". You could program in a "cleaner Java" translate it to vanilla Java, then commit, and nobody would know the difference.

If you ever tried to push some Java-generated code in the repository I will never ever approve your pull request. It's simply one of the most wrong thing that you can do on so many levels that I really don't know from where to start. You will need to keep track separately of the kotlin code and Java code and keep them in synch. You cannot use the repository because, per your admission, you are doing this in secret, s…

Have I ever committed auto generated Java?

Yes. At one job my predecessor had done significant work in Java and somehow the only the compiled files were left behind. We reverse compiled them and that was my starting point for the project. As you can imaging the generated code was perfectly formated, with a very consistent style, and generic variable names. It wasn't terrible to work with.

The language I'm proposing probably couldn't be too different than Java. But one trivial example would be to make all variables final by default unless they were marked "notfinal". This would be different than Java, and thus would be a new language. And it would be trivial to translate back and forth between this language and Java. Nobody could ever tell the difference. Granted all you would really be changing is syntax, which may or may not be worth while.

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

#88

Features: ========= * compiles to Java and Javascript * null safety (optionality) * Lean syntax * Exceptions are unchecked. * Extension functions let you add methods to classes without modifying their source code. * Operator overloading * No macros * Markdown instead of HTML for your API docs * Better Java generics. * Delegation (forwarding methods) * String interpolation Seriously underwhelming....

I initially used Kotlin for a project at work, and I would agree that it is underwhelming. Pivotal had announced official support for Kotlin with Spring Boot, which is what motivated me to give it a try. However, there was no support for the @Transactional annotation in Kotlin at the time, so I ended up writing a decent amount of Java anyways. Then there was a compatibility issue with one of our internal libraries, and I had to rewrite all of the controllers in Java. By the time the project was finished, the majority of the code was in Java, and I hadn't really gotten any benefit out of the Kotlin, so I decided to just use Lombok and replace all of the Kotlin code with Java. My builds got about 3 times faster after that because Kotlin seems to have performance issues with Gradle.

The 1.1 release is promising many features that make me want to revisit it, though: https://blog.jetbrains.com/kotlin/2016/04/kotlin-post-1-0-ro...

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

#89
post #56

I am a bit in a hurry, so I acknowledge I only quickly scanned the article. But it struck me as damning by faint praise. Like a waiter advising, "Choose the chicken parm. It doesn't have any bones, all the salmonella has been cooked out, and it doesn't have any bad flavor." If I'm going to be successfully pitched a programming language, I will need to see its power of expression or be shown how it solves some problem…

I think that might be what's needed for a really good programming language. If you want a general-purpose language, you probably don't want something unique and envelope-pushing - you just want a language that avoids all the mistakes that are so common, that learns from what's gone before. Like buying a table - you usually don't want a radical table that can do something other tables can't, you just want a good solid…

It is interesting that when I considered next language to write a side-project in, I was choosing between Ceylon and Kotlin.

In the end I did choose Kotlin. My reasons included:

* support in IDEA

* focus on java interoperability

* nice interop with android

but the main thing probably was, that I trust JetBrains that they will support Kotlin in the long term, while I don't think RedHat has any projects depending on the language.

So, why would you choose Ceylon?

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

#90
post #40

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

It still is. Kotlin advocates are just very loud, while Scala devs are busy shipping real-world software projects.

If Brainfuck had the marketing dollars that Typesafe spent then you would see real-world shipping Brainfuck projects. It wouldn't make Brainfuck a good language.
Post reply on HN