Hate to learn kotlin for android. Looks bullshit.

  • 2
    Which part looks bs?
  • 2
    @orhun syntax.
  • 4
    Is good. Removes 99.9% of null pointer exceptions (unless you use !!, then its your fault) and lambda functions are easier. I really like the syntax. Less verbose then java.
  • 5
    The syntax might look like bullshit a few times, but I think there are really clever solutions in the language. E.g. if you start to understand why are lambdas enclosed in curly braces, then you can start writing better code structure.
  • 4
    Then dont. Just write java, and convert it to kotlin with android studio.
  • 2
    You must focus on language features more than syntax.
    Sometimes Rust has shitty syntax too.
  • 4
    My code looks a lot cleaner in Kotlin compared to Java. Removes much unnecessary bloat tbf, but that's just my experience.
  • 4
    @tekashi Converting most of the times uses !! which kills the null check magic unfortunately. And you wouldn't write code the way it is converted if you used kotlin from the start. So I can't recommend doing it. Have you got an other experience with it? Tbf I used the conversion feature 2 years ago. Maybe it was improved a lot by now.
  • 2
    @ShotgunSurgeon no, i stay the fuck away from android, if i really have to make something for it i usually use react. Tried kotlin separately, felt like a cheap knockoff scala.
  • 1
    @tekashi Yes you are right it has a lot of similarities to Scala and they don't hide that they took quite some ideas from it and groovy and such. I don't do android development anymore but I built a kotlin spring boot backend once that was started in Java and was converted to kotlin. that almost killed most of the advantages kotlin offers. I still liked kotlin for its briefness
  • 3
    @orhun well yes rust has unusual syntax but I don't need two characters for the assign variable operator

    For me Kotlin just doesn't flow well. Don't really know why though. I really want to give it a try but constantly need to to look up the special syntax for it.

    Meanwhile in rust I spent the time fighting the borrow checker as syntax there may be strange in some parts but at least it's consistent.
  • 1
    I love Kotlin. I understand that you hate it. It's nothing like Java if you go nuts with all the syntactic sugar available. But beware, all that sugar might incur unnecessary CPU or memory load. If not at runtime, then certainly at compile time.

    So if you prefer Java, just write Java like code in Kotlin and that will work most of the time. You'll still get the benefit of the stronger and safer type system. But no true sugar, if that's what you dislike.

    Android Studio will suggest more idiomatic Kotlin if you really write bad Kotlin using Java syntax patterns. That way you can have the best of both worlds!
  • 1

  • 1

    "Rust has shitty syntax too."

    When has rust not had shitty syntax?

    Before or after the cargo cult?
Add Comment