News for hackers. Stuff that matters.
Re:Android now supports Kotlin by leshow on Wednesday May 17, 2017 @04:27PM (#14362493)
I tend to agree. Sure, Kotlin is much more terse than Java. But looking at it I can't help much miss language features I've gotten used to in Rust, Haskell et al. I'm sure it's a wonderful language and an improvement over Java but there's nothing that excites me about it.

Hey, at least they've got nullable types? That's a big win over Java right there.

Re:Android now supports Kotlin by rifung on Wednesday May 17, 2017 @11:35PM (#14364650)
> Hey, at least they've got nullable types? That's a big win over Java right there.

Can you elaborate what you mean by nullable types?

You can set Object variables to null and with primitives you can do the same with their boxed alternatives (Integer) but I assume you mean something different?

Like the lack of types which can't be null? I can see how that's useful

Re:Android now supports Kotlin by leshow on Thursday May 18, 2017 @02:27PM (#14369749)
non-nullable*, Swift calls them optional types I believe. They use the same syntax for it, if you want your type to include "bottom" you add a ?

In Kotlin/Swift by default all types do not include "bottom" or "null". You add a ? to the type to indicate you may use that value, then the compiler will validate you're checking for the existence of null before you use the type.

It's one approach... I prefer the Haskell approach with a simple Maybe/Option type.

Re:Android now supports Kotlin by afastow on Thursday May 18, 2017 @12:43AM (#14364859)
I think they meant to say that Kotlin has non-nullable types.

The Kotlin page does a good job of explaining it if you aren't familiar. It's the single most important feature that makes Kotlin worth using over Java in my opinion: https://kotlinlang.org/docs/reference/null-safety.html