4 ms·
Slightly related : like many Android engineers, I fell in love with Kotlin. It is a very pragmatic language which solves many big issues with java 6.5 we use
by on_and_off 11y ago
Slightly related : like many Android engineers, I fell in love with Kotlin.
It is a very pragmatic language which solves many big issues with java 6.5 we use on mobile.
However, getting it adopted in a big project with a dozen of engineers of various levels and a massive 300k LOC repo is a daunting task.
Even though it is a undoubtedly a better language, making such a switch is too frightening for the lead dev.
Of course, Kotlin has the additional disadvantage of not being officially sponsored by Google on Android.
- niutech 11y agoIf you want to retain compatibility with legacy code, use Xtend (http://xtend-lang.org http://xtend-lang.org), which compiles down to Java 5.
- on_and_off 11y agoKotlin is already entirely interop with java : it compiles to bytecode compatible with jvm 6. The problem is an unwillingness to switch to a new language ("we do just fine with java") coupled with the fact that ideally everyone in the team should get familiar with it.
- burjui 11y ago> "we do just fine with java" Yeah, except they write 2-5 times more code in Java, than they would in Kotlin. I think it's unprofessional to reject a new language, that will make code smaller and easier to understand, just because somebody is afraid to step out of his comfort zone for a moment, and not because of some potential real problems. I think you can justify anything with that stupid line of thinking: "I don't use for-loops, because a while-loop can do the same, and it's too hard for me to learn it." Sounds the same to me. Learning Kotlin is a must for any Android developer, unless he really likes to give handjobs to the Java compiler: "Oh, let my type the name of the type twice, even if it's quite long for clarity and you know it already from the right hand of the assignment. You want me to write 23 lines of boilerplate in a separate file for a POJO with 2 fields? Oh, you dirty boy!"
- on_and_off 11y ago>I don't use for-loops, because a while-loop can do the same, and it's too hard for me to learn. Pretty much. Older engineer. He remembers the transition from blackberry to Android and is not ready for another one. He almost advocates for the use of Vectors ... Unfortunately he is also Lead Engineer, which makes matters complicated. Kotlin is far from the only subject where we butt heads. I also had to put his nose on all the leaks created by his atrocious 'architecture' in order to start working on a fix. I don't think there is a good solution for that kind of problems other than throwing the towel and move to another company. I plan to emigrate anyway, so there is that. There are true reasons to avoid Kotlin at the moment though : -slower compilation (we have a huge codebase and dexing is already an issue). -the whole team needs to move to it and since we are more than a dozen, it is a significant task. -Kotlin does not support Android Lint, so common issues like using an API 21 method with minApiLvl = 17 can occur unnoticed.
- niutech 11y agoCompiling to Java code > compiling to bytecode. With Xtend, you get much better Java interop due to using exactly the same type system and you can use all the goodness of the original Javac.