Re:Kotlin 1.0.5 is here
by Nullabillity on Tuesday November 08, 2016 @04:07PM
(#12903945)
Also, 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.
Re:Kotlin 1.0.5 is here
by gregschlom on Tuesday November 08, 2016 @04:15PM
(#12903996)
Wouldn'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.
Re:Kotlin 1.0.5 is here
by Nullabillity on Wednesday November 09, 2016 @01:42AM
(#12906793)
Oh wow, wasn't aware that existed. Thanks!
Re:Kotlin 1.0.5 is here
by BoorishBears on Tuesday November 08, 2016 @06:48PM
(#12905036)
People still use RoboGuice?
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.