We have
been waiting so long for lambda expressions in Java and now we are one step
from the release of Java 8, provided it won’t be postponed again :-) Before writing this article, I thought the release is planned for the fall 2013 and now I
found, it was postponed again to early 2014.
And the original plan was late
2012! With Lambda project as the main reason of the postponing, it must be
really perfect when it is finished :-)
But
postponing the release of Java 8 is not what I am going to write. What I want
to write about, is the Lambda project, but not as you would expect.
So much has been written about Lambda in Java,
that everybody must know it and I believe nearly everybody is looking forward to use
it. You can try it right now with Early Access Release available here.
I don’t doubt you will try it just for fun. I did and really enjoyed it. But what about production code?
Will you use it? With so much attention to Lambda, lot of articles about the
usage of Lambda is emerging. I remember three issues with Lambda can come to my code
(maybe there are more):
- Stack trace – when exception is thrown inside of lambda function, the stack trace is ugly and not very informative.
- Debugging – debugging isn’t very comfortable
- Breaking DRY principle – you write same lambdas all over your code. Actually this one can be overcome with a factory class for your lambdas.
Maybe there
are more issues, maybe those mentioned above are no issues, but only
inconveniences :-) And if they were, would it stop you from using lambdas in
your code?
Komentáře
Okomentovat