3 ms·
Why wouldn't they just extend their existing syntax? i.e. something like if (p is Point(x,y)){ //p : Point, x: int, y: int } or hell, adopt any other
by ImprobableTruth 6y ago
Why wouldn't they just extend their existing syntax?
i.e. something like
if (p is Point(x,y)){
//p : Point, x: int, y: int
}
or hell, adopt any other pattern matching syntax.
"Either they adopt the java syntax or are missing features" seems like a false dilemma to me.
- rzwitserloot 6y agoIf they adopt other syntax, then kotlin is no longer 'java, with the warts papered over'.
- ImprobableTruth 6y agoBecause they'd be using 'is' instead of 'instanceof'? That just really doesn't strike me as a meaningful difference. Hell, they already have a lot of way more crazy changes (the radically different lambda syntax, different function signature, functions outside classes, extension functions, etc). By your reasoning they're already way past the point where "it's 'easy' to switch from java to kotlin".
- stickfigure 6y agoThere are already plenty of differences between Kotlin and Java, this would be a minor one. I work reasonably comfortably in Java (largely due to lombok - thanks!) but keep an eye on Kotlin and... well, I much prefer the Kotlin syntax here. I'm sure in the 5% case changing variable names is useful, but in the 95% case it's just noise.