<@U0BLU7JTA> could you possibly give another examp...
# language-proposals
e
@dmitry.petrov could you possibly give another example?
d
Another example of... what?
Probably the most important problem is that you can't implement Java-like collections in pure Kotlin without some redundancy in generated code (that will also affect performance). E.g., an
ArrayList
that allocates an internal array with extra capacity. Nullability of elements is guarded by external invariants, and you don't want explicit checks for each
get
.
c
yeah that was my takeaway the Java boat anchor making a mess out of what was already a challenge…
d
Well, if you could think of a better ArrayList implementation in pure Kotlin that would be just as efficient... The problem here is not exactly Java, but performance. Either you have explicit null checks, or you say that a given value is never null. There's no third option, like "it can be null in general, but here I guarantee that it's not null".
👍 1