3 ms·
Yeah, I only included the link as a proof that we're actually using Kotlin in production :) 1. Kotlin issues: - Libraries that use reflection (such as Gson)
by gregschlom 10y ago
Yeah, I only included the link as a proof that we're actually using Kotlin in production :)
1. Kotlin issues:
- Libraries that use reflection (such as Gson) can break some assumptions that Kotlin makes (for example, a read-only field may actually change). There's maybe 2 or 3 little things like that that may catch you by surprise, but once you figure them out it's easy to work around them.
- Stack traces in lambdas are obscure sometimes. Sometimes you won't get the line number.
- Proguard integration has proven challenging.
2. We started from Kotlin.
3. Learning Clojure and Haskell has made me yearn for more functional languages and better type systems. Kotlin has that, in a neat syntax that's very beginners friendly.
I'm firmly convinced that a good programming language needs:
- Strong library ecosystem
- Static type system + type inference. (I won't get into the static/dynamic argument here. Suffice to say that there's a whole class of bugs that you can avoid with static typing, and type inference makes the "but I hate these types cluttering my code" argument irrelevant)
- Killer IDE support (essential for productivity. If you're writing a large application without using an IDE that gives you code inspection and navigation, you're wasting your time)
Kotlin has these 3 things.
4. Top improvement: can't wait for Kotlin 1.1 to be released, and start using coroutines. Other than that, I'm happy with it.
- Nullabillity 10y agoAlso, using it with RoboGuice is a bit annoying. At the moment I use vals, but it still requires me to mark injected dependencies as nullable (and coerce them with !! on use), which feels like I'm fighting the type system. It would be really nice if there was some sort of "special" null that was of the non-nullable type, but could only be used when initializing variables.
- gregschlom 10y agoWouldn't a `lateinit var` solve the problem in this case? (Although the downside is that now it's a variable) Otherwise I'm sure you can come up with a good solution using delegated properties or something like that.
- Nullabillity 10y agoOh wow, wasn't aware that existed. Thanks!
- BoorishBears 10y agoPeople still use RoboGuice?
- deleted 10y ago[deleted]