News for hackers. Stuff that matters.
Re:Kotlin: A New Hope in a Java 6 Wasteland by oweiler on Monday September 28, 2015 @11:16AM (#10290864)
Compared to Java 8 Kotlin still has quite a lot to offer:

* Type-safe DSLs

* Named parameters with default values

* Non-nullable types

* Raw strings (which make working with regular expressions quite nice)

* Type inference

* Properties

* Smart casts

* the when keyword which is much better than using switch statements

* data classes (very nice when working with APIs which expect Java beans)

* a lot of stuff I probably forgot

Re:Kotlin: A New Hope in a Java 6 Wasteland by rattray on Monday September 28, 2015 @12:36PM (#10291327)
first-class functions is another big one
Re:Kotlin: A New Hope in a Java 6 Wasteland by pohl on Monday September 28, 2015 @01:01PM (#10291486)
That was the headline feature of Java 8.
Re:Kotlin: A New Hope in a Java 6 Wasteland by NhanH on Monday September 28, 2015 @02:14PM (#10291981)
Java functions are still not first class. The headline feature of Java 8 was lambda function, which arguably isn't first class either (they are implemented as instances of object subtype, so essentially still is object nonetheless)
Re:Kotlin: A New Hope in a Java 6 Wasteland by steveklabnik on Monday September 28, 2015 @07:54PM (#10293949)

  >  so essentially still is object nonetheless
http://www.c2.com/cgi/wiki?ClosuresAndObjectsAreEquivalent
Re:Kotlin: A New Hope in a Java 6 Wasteland by adrusi on Monday September 28, 2015 @04:15PM (#10292882)
They also don't close over their parent scope.
Re:Kotlin: A New Hope in a Java 6 Wasteland by jnericks on Tuesday September 29, 2015 @06:49PM (#10300365)

  // this hack is gross  
  final String[] val = new String[1];  
  Callable func = () -> val[0] = "Hello";  
  func.call();  
  System.out.print(val[0]);
Re:Kotlin: A New Hope in a Java 6 Wasteland by mike_hearn on Monday September 28, 2015 @06:21PM (#10293598)
First class functions mean you can define functions outside of classes. Java 8 does not have any such feature.

Kotlin has quite a lot of hidden treasures in it, typically at the intersection points of several features. People who think of it as a better Java, or something Java can easily catch up with, should take a closer look.

Re:Kotlin: A New Hope in a Java 6 Wasteland by yareally on Monday September 28, 2015 @09:47PM (#10294304)
Technically first class functions means functions can be treated like objects and passed around like any object (for example, python).

That said, I agree with you that Java does not have first class functions. They have something tacked on that is nowhere as elegant and lacks full support.

On the other hand, not every language that lets you define functions outside of classes lets you treat them like objects. C for example is generally not considered a language with true first class functions because it doesn't allow passing nested ones without additional support within the chosen complier.

Re:Kotlin: A New Hope in a Java 6 Wasteland by mike_hearn on Tuesday September 29, 2015 @07:20AM (#10295559)
Alright, in that case Kotlin has that other sense of first class functions as well. You can get a function typed object that supports the invoke operator, amongst other things.
Re:Kotlin: A New Hope in a Java 6 Wasteland by tomjen3 on Monday September 28, 2015 @05:03PM (#10293184)
Kotlin can inline lambdas (sometimes), which matters a lot on Android. For example there is no over head to writing your code so that it uses map and a lambda to writing a native loop.

In addition, because the code is inlined it can use the actual type of generic arguments. Not sure when that is useful.