4 ms·
I'd argue that there already is, in well written libraries, an artificial boundary. Library APIs often have to be written for the consumption of others, so more
by cromwellian 13y ago
I'd argue that there already is, in well written libraries, an artificial boundary. Library APIs often have to be written for the consumption of others, so more care is usually given (in well written) libraries.
You don't really need to create any function interfaces for most expressions since the most common ones are pre-defined (Supplier, Consumer, Predicate, Function, UnaryOp, BinaryOp, etc), and the basic rules allow a lot of flexibility.
I've been doing a lot of Java8 recently due to work integrating it into GWT (https://plus.google.com/+RayCromwell/posts/C4QYmWWQguT https://plus.google.com/+RayCromwell/posts/C4QYmWWQguT) and the experience has been delightful. In actual use (as opposed to testcases), it's been very economical, especially the this::foo constructor vs the JS equivalent which needs bind(), and the fact that you get good auto-complete is great.
- ajanuary 13y agoMy comment was poorly phrased regarding libraries. What I meant was there's plenty of code if want to use lambdas for that isn't a carefully planned api boundary. Even with the provided function interfaces I worry there will be cases they don't cover which means people won't use anonymous functions where they're useful. However, given you seem to have used Java 8 and. I haven't, I'll relent :)