25

Going to refactor my whole android app from java to kotlin

Wish me luck!

Comments
  • 1
    Good luck!
  • 2
    Good luck and keep us posted. Kotlin is on my list of things to learn. So I'd like to hear how it went. :)
  • 0
    Gl! Not sure refactoring is the right word though...
  • 2
    What's the motivation behind it ?
  • 1
    @-psr There are 2 main reasons
    1. I want to learn more about kotlin and I think changing my current code will help me understand it better
    2. Kotlin has less boilerplate
  • 0
    You can ignore lateinit warnings, they keep your code more organized, but not mandatory to use.

    ??variable is your friend. Use it. Refactor your logic if needed. It will be worth it.

    Refactor your shitty workarounds caused by Java being such a jerk with nulls.

    Use foreach returns, they are weird to use but absolutely a work of art if you are used to it.

    Keep your static variables at the bottom, inside of a union class ( i name it like that, i forgot the whole thing ), for tidying purposes.

    If you use something like Android Studio, it will recommend you that anyways.

    Some code snippets are not easily converted to Kotlin, expect some hardships and a learning curve.
Add Comment