3 ms·
Don't get me wrong, I mostly like working Kotlin. But the more I do, the more I realize what a hodgepodge of features it really is. A bunch of features don't re
by ragnese 5y ago
Don't get me wrong, I mostly like working Kotlin. But the more I do, the more I realize what a hodgepodge of features it really is. A bunch of features don't really work together that well. And a bunch of features are only 80% (or less) of what I actually want.
For example, what if I don't like data class's stupid copy() method? How do I opt out? You can't.
Value classes can't be used as varargs, can't implement an interface by delegating to the wrapped value. (Forgetting the fact that they're just buggy as all hell and I keep getting runtime crashes from them being overly aggressively optimized away)
And it, of course, inherits a ton of badness from Java. Like the crappy type-erased generics, lack of type classes, etc. It chose to just use Java's standard collection types and encourage copies instead of using persistent collections by default. It hides the mutability under "read only" interfaces, but that's not at all concurrency-safe. Map is not a Collection or an Iterable, which is dumb. Map<K, V>'s type parameters are also allowed to be nullable types, which means that Map.getOrElse{} is actually wrong in the standard library.
Since Kotlin chose nullable types instead of Option<T>, you can't express "nested" emptiness. This means that the Map API is janky if you need to store nullable types. Map.get returns null if there was no value stored, but what if the value stored IS null? Then you have to call Map.contains(key), which means you have to hash the key twice to reliably pull out values.
There's just a lot of papercuts.
- specialist 5y agoBelated thank you. I've been chewing on your observations. You're absolutely right about the papercuts. I have to ponder the (lightweight) value objects stuff. And > you can't express "nested" emptiness Spot on. I dislike all the current null mitigations: nullability (question marks), @nullable, Optional<?>. My hobby language takes a different path. All nulls are actually Null Objects (under the hood). So method chaining cannot break. re: type classes Ya, a nice reminder that I need to learn Haskel. Stuff like that is still beyond me. I hope innovators continue to noodle with more accessible Haskel, Ocaml, etc. Being late in my career, I'm motivated to create a better "blue collar" programming language for 99% of the work I've done. Meaning data processing. Ingest data, mostly strings, munge stuff, spit out results.