Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
geyforkotlin
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
4 ms
·
1.
▲
by
geyforkotlin
4y ago
I mean, generally I would love (more) union types, unfortunately so few languages have them. For Ops requirement I think it's too specific for a language level feature. In Kotlin you'd just use a sealed type in the cases were you
2.
▲
by
geyforkotlin
4y ago
> Well, try to minimize the usage of nulls in your programs then :D I am a java guy since 1.1 and it seems to me that a lot of problems in Java come down to it being designed for a time when a application mainly consisted of in-house &#x
3.
▲
by
geyforkotlin
4y ago
When I first got into Kotlin I thought that null safety was a matter of getting rid of null, like some try to do in their Java code. Now I know that actually it gives me liberty to safely use null wherever I want and not have to worry about
4.
▲
by
geyforkotlin
4y ago
basically that's how it works in Kotlin (and Dart and others) already. String? is String|null and it's a compiler error to reference a member without a prior null check. In Kotlin (and others) it's extremely ergonomic, too. Y