Live data from Hacker News

Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

news.ycombinator.com

81–90 of 203 posts

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#81
post #55

Earlier quoted context omitted.

What Kotlin still misses is somehow a good testing ability, to test it via Java Test Suites seems strange. Also I still miss a good build tool. I mean Maven really sucks, Gradle is kind of okai, but there is no support of autoreload project on change (like sbt has via sbt-revolver or playframework internals) however that is mostly helping web development. Also some other things aren't really written out, like threadi…

> What Kotlin still misses is somehow a good testing ability, to test it via Java Test Suites seems strange. Why? > I mean Maven really sucks Why? > Also these days a language needs Dependency Injection There's plenty of JVM libraries that provide it. Why does a language need to provide it?

> I mean Maven really sucks

Why?

I think after a while one gets tired of using XML as a configuration language. It's verbose and not the easiest to read. Beyond that, we used to find ourselves in dependency hell with maven pretty frequently, though that hasn't happened to me in a few years.

The biggest problem, imho, is that it's inflexible. You can't just (easily) throw in a bit of functionality or make an unusual tweak to your build. So, if you can't find an existing plugin to do what you need, you have to write it yourself.

I've written a maven plugin, and the documentation/support was rather poor. I also found myself having to use an older version of various plugin libraries in order to write proper tests for the plugin. It took me a couple of weeks. Had I done all that in Gradle, I could have just thrown in a few lines of groovy and probably finished in a day.

That said, it's stable and well known. Gradle seems to have the momentum and increasing mindshare, but you probably won't get fired for using maven.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#82
post #9

I started an open source Android project in Kotlin ( https://github.com/dodyg ) three years ago so I have witnessed the language evolution from early on. This is what I love about Kotlin: - It is IMHO the best language to develop native application in Android by far. - I was primarily a C# developer (still now) and I could pick up the language in a day. The language is quite small for people that has already known a…

When you say "Java 100% compatibility", does it mean you can rename a .java to .kotlin and kotlin compile would never complain?

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#83
post #9

I started an open source Android project in Kotlin ( https://github.com/dodyg ) three years ago so I have witnessed the language evolution from early on. This is what I love about Kotlin: - It is IMHO the best language to develop native application in Android by far. - I was primarily a C# developer (still now) and I could pick up the language in a day. The language is quite small for people that has already known a…

When you say "Java 100% compatibility", does it mean you can rename a .java to .kotlin and kotlin compile would never complain?

You can mix and match Java files and Kotlin files in the same project without a problem. Also, for any Java file you can ask IDEA's Kotlin plugin to automatically convert it to Kotlin for you, and likewise if you cut-and-paste Java code into a Kotlin file it will ask if you want to rewrite that code block.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#84

I tried Kotlin ~2 years ago and generally liked it. However, one thing that I missed is the possibility to generate Javadoc besides KDoc. This would be useful when writing a library in Kotlin to Java developers who are 'not in the know'. Any idea if this is possible now?

That is a very cool idea.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#85
post #75

Well, let's look at the JVM landscape. First of all Oracle has (finally) picked up the pace in terms of evolving Java and the JVM. This is a bit of a double edged sword for alternative JVM languages since on the one hand JVM improvements (like current SAMs and value types in Java 10) are a big win for all involved, but on the other, Java's evolution is very much a threat to Scala, Kotlin, and Ceylon in particular* Wh…

I find it highly unlikely that java would adopt the implicit lambdas using underscores from Scala. The rules regarding precedence themselves are quite simple, but they're not always what new users expect, and cause too much confusion to be appropriate in java. Much more likely is the use of the underscore as an anonymous placeholder in pattern matching. Although even full pattern matching seems a bit much for java in…

> I find it highly unlikely that java would adopt the implicit lambdas using underscores from Scala

Looks like you're right [1], see Goetz's comment in linked thread. Though that was 2 years ago, the language landscape has changed (notably Swift's arrival and M$ setting up shop on *nix) so Oracle may be a bit more willing to pull the trigger on some easy syntactic sugar to give Java the impression of being somewhat up-to-date with current languages. Underscore is earmarked for something regardless, we'll see..

[1] http://mail.openjdk.java.net/pipermail/lambda-dev/2013-Augus...

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#86
post #44

Earlier quoted context omitted.

Lambda inlining only works for very narrow scenarios. Passing a lambda to any Java API, such as event handlers in Android, will always have to resort to an anonymous class translation strategy, which generates a static or instance method in the outer class and a lambda class implementing the functional interface, forwarding to the outer class method. Non-capturing lambdas can be instantiated once and cached staticall…

Thanks for the info! I did know that passing lambdas to Java API calls still has to instantiate an anonymous inner class, but the details about what happens in each situation are new to me (and really interesting). I'm sorry that I didn't make it clearer in my post (I'll edit it), but the thing I really appreciate is that I can use functional methods on objects (like map, fold, filter on iterables or our monadic bind…

Only a look at the resulting bytecode will tell you what happens in your scenarios :)

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#87

Earlier quoted context omitted.

When you say "Java 100% compatibility", does it mean you can rename a .java to .kotlin and kotlin compile would never complain?

You can mix and match Java files and Kotlin files in the same project without a problem. Also, for any Java file you can ask IDEA's Kotlin plugin to automatically convert it to Kotlin for you, and likewise if you cut-and-paste Java code into a Kotlin file it will ask if you want to rewrite that code block.

I think more importantly. You can interact with any Kotlin class from Java, and vice versa.

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#88
post #55
post #14

At JetBrains we're using Kotlin on a few projects now. Some of them are internal, some are public facing. In addition, some of our existing (and new) products are now using Kotlin. IntelliJ IDEA 15 will be shipping with Kotlin plugin enabled by default. Kotlin is a tool we created out of need. We're using it and we're relying on it, so I'd say it's got a very good long term viability.

What Kotlin still misses is somehow a good testing ability, to test it via Java Test Suites seems strange. Also I still miss a good build tool. I mean Maven really sucks, Gradle is kind of okai, but there is no support of autoreload project on change (like sbt has via sbt-revolver or playframework internals) however that is mostly helping web development. Also some other things aren't really written out, like threadi…

Gradle 2.5 has (finally) added continuous build support

Re: Ask HN: Has anyone here programmed in Kotlin? What do you think about it?

#90

I wrote about Kotlin quite some time ago.[0] I have to say that at the time, I was quite impressed by it all. There were some really good features, it had a much smaller dependency compared to Scala, and so packaging a Kotlin application was a lot easier than say an application in Scala. But to answer your question, there are a few benefits and drawbacks of Kotlin as a language and a platform: + World class IDE suppo…

"I think that at one point go is going to become the defacto language for Android since google likes to keep everything in-house." As someone who writes Android/Java code for the day job but who prefers coding in Go whenever I have the chance, I'd love for this happen but I doubt it will anytime in the foreseeable future. There's just way too much invested in all of the Android Java Platform/UI/etc APIs which would m…

I had kinda hoped that the lawsuit over Java APIs would give them motivation to switch to Golang. :(
Post reply on HN