Live data from Hacker News

Kotlin vs. Java – An Android Developer's First Impressions

arctouch.com

1–10 of 23 posts

Re: Kotlin vs. Java – An Android Developer's First Impressions

#4
post #2

Perhaps a little off-topic, but can anyone share their experience with using Kotlin to build a non-trivial web app and what their stack was?

I work at one of those big tech companies which has a huge number of services in its codebase in Java (you could properly guess the company). We use Kotlin daily for back-end services as a cleaner and more powerful Java, and we've migrated most of our original Java spring/rest projects to be in Kotlin. If you're familiar with Java-based stacks, I think it's fairly trivial to migrate to Kotlin first as a Java substitute before taking advantage of everything Kotlin has to offer, then slowly adopting Kotlin principles.

Re: Kotlin vs. Java – An Android Developer's First Impressions

#5
post #3

Off-topic but is anyone else unable to scroll on this page?

Works for me.

Whenever you have such a complaint - and choose to make it public - please include more details. What system, what browser, add-ons (adblocker) at least.

EDIT: Downvotes? For answering the question truthfully? It does work for me. The question was (is) "is anyone else unable to scroll on this page?" -- and I have no problem scrolling. I answered the question! The question was NOT "do you think the page is designed badly". If that is what was meant, that is why I said "needs more details". All the person asked was about "being able to scroll"! And the design issue does not prevent it. I answered the question that was actually asked! I assumed, and still do, that the person isn't able to scroll at all.

Re: Kotlin vs. Java – An Android Developer's First Impressions

#6
Not to sound disparaging, but could this basically be summed up as "Kotlin is the syntactic sugar version of Java"?

I mean, ignoring functional stuff which is in Java 8 but not on Android because Android is still(?) on Java 7, that's all I'm really seeing here.

Re: Kotlin vs. Java – An Android Developer's First Impressions

#7
I've used Java very little. But about 1-2 years ago, on a long trip, and after learning about Kotlin on Android (iOS developer here) I decided to create a prototype of our iOS app on Android using Kotlin. Apart from some weirdness on the Android API (which Java, Kotlin, Groovy, etc) don't fix, I found myself very productive and created a fun prototype over a 14 hour flight that got me the OK to develop the first version of our Android app.

If you have developed in Swift (and probably other languages), Kotlin will feel very similar, the only thing you need to do is learn the native API's, but logic/model code is so similar you can just copy paste from swift->kotlin and vice versa and just fix 2-3 syntax issues

Re: Kotlin vs. Java – An Android Developer's First Impressions

#8

Not to sound disparaging, but could this basically be summed up as "Kotlin is the syntactic sugar version of Java"? I mean, ignoring functional stuff which is in Java 8 but not on Android because Android is still(?) on Java 7, that's all I'm really seeing here.

Android actually now has some Java 8 feature support out-of-the-box [0] though most are API 24+.

After porting our code base to Kotlin we found it provides more benefits over Java than just being less typing / "syntactic sugar". To name a few:

  - First class functional support (streams feel clunky in comparison).
  - Extension functions [1].
  - Nullable types (compile-time null checking).
  - Less verbose as types declarations are optional in many situations.
  - Great interop & tooling from JetBrains makes a slow transition from Java -> Kotlin pretty seamless.
[0] https://developer.android.com/studio/preview/features/java8-...

[1] https://kotlinlang.org/docs/reference/extensions.html

Re: Kotlin vs. Java – An Android Developer's First Impressions

#9

Not to sound disparaging, but could this basically be summed up as "Kotlin is the syntactic sugar version of Java"? I mean, ignoring functional stuff which is in Java 8 but not on Android because Android is still(?) on Java 7, that's all I'm really seeing here.

As of Android 7, the following Java 8 language features are supported:

  Default and static interface methods  
  Lambda expressions  
  Repeatable annotations  
  Method References  
  Type Annotations

Re: Kotlin vs. Java – An Android Developer's First Impressions

#10
post #3

Off-topic but is anyone else unable to scroll on this page?

Works for me. Whenever you have such a complaint - and choose to make it public - please include more details. What system, what browser, add-ons (adblocker) at least. EDIT: Downvotes? For answering the question truthfully? It does work for me. The question was (is) "is anyone else unable to scroll on this page?" -- and I have no problem scrolling. I answered the question! The question was NOT "do you think the page…

It's got odd scrolling. If the mouse is over the top banner, and you scroll the scroll wheel (or I assume pull down on mobile?) then the page doesn't scroll (this is on Chrome, on Windows 10).

The scrollbar is also hidden behind the top banner in some way, which suggests it's doing something non standard.

Why do people want to fiddle with the most basic UI/X idiom on the net?

Post reply on HN