4 ms·
A lot of the things you can do with LINQ you can do in Java now there are lambdas and method references. e.g. http://benjiweber.co.uk/blog/2013/12/28/typesafe-d
by benjiweber 13y ago
A lot of the things you can do with LINQ you can do in Java now there are lambdas and method references. e.g. http://benjiweber.co.uk/blog/2013/12/28/typesafe-database-interaction-with-java-8/ http://benjiweber.co.uk/blog/2013/12/28/typesafe-database-in...
Properties you could simulate with lambdas now. something like Property<String> name = get(() -> name).set(name -> this.name = name);
You would lose all the existing framework support that assumes getters and setters doing that though.
Some of the generics failure will likely be fixed in 9 (Primitive specialisation). Other things are not as bad as some people think (At least generic supertype params are available at runtime)
- benjiweber 13y agoHere's that example of Property implementation https://github.com/benjiman/expressions/blob/master/src/test/java/uk/co/benjiweber/expressions/PropertyTest.java https://github.com/benjiman/expressions/blob/master/src/test... https://github.com/benjiman/expressions/blob/master/src/main/java/uk/co/benjiweber/expressions/Property.java https://github.com/benjiman/expressions/blob/master/src/main...
- kvb 13y agoThat's an impressive proof of concept, but without expression trees it can't quite measure up (e.g. you need to remember to use `.and` instead of being able to use `&&`).