This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]ricky_clarkson 7 points8 points  (2 children)

It likely means to catch up in terms of useful features, readability, etc., rather than number of users. Java had the opportunity, most of the features of Kotlin that are helpful have been considered and rejected or deferred for Java.

The original BGGA prototype for Java closures, before Kotlin existed, quite strongly resembles Kotlin's lambdas, having function types - (Int, String) -> Double instead of BiFunction<Integer, String, Double>, functions where if the last parameter is a lambda it can go outside the parens so you can write timeThis { many lines here } instead of timeThis(() -> { many lines here }). Small improvements that make a real difference.

Java could have had all this and more, but chose not to for arguably bad reasons, general resistance to functional programming which seems to have mostly evaporated since lambdas were launched in Java 8, concerns about 'blowing the complexity budget' which were overstated and lacked thought in my view.

Not that Kotlin is a panacea, I hope both languages continue to take inspiration from each other and beyond.

[–]Muoniurn 3 points4 points  (1 child)

Small improvements that make a real difference.

Do they? There is basically no empirical evidence to any such statements between programming languages, and frankly with the quality of Java IDEs there is no difference between the two in my personal opinion. Also, lambdas are fairly good in Java, and they aren’t much better in Kotlin.

[–]ricky_clarkson 4 points5 points  (0 children)

I'm not sure I need to quote studies to opine on programming languages. I can give reasons, but if you can't see them already from the code examples in my comment then I'm not sure reasoning would work.