Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I agree. I have been doing the Kotlin Koans (https://try.kotlinlang.org/#/Kotlin%20Koans/), and so far it has a lot of nice functionalities that make coding more fun.

Just the way it allows you to create an inmutable class in a single line already makes it way easier to read, while also saving time.

Compare Java:

  public class Person {
      private final String name;
      private final int age;

      public Person(String name, int age) {
          this.name = name;
          this.age = age;
      }

      public String getName() {
          return name;
      }

      public int getAge() {
          return age;
      }
  }
With Kotlin:

  data class Person(val name: String, val age: Int)


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: