In many ways, Java as a language has stood the test of time well. It’s still an incredibly popular platform and a good choice for developing enterprise business software. A vast array of open source libraries and frameworks have been developed, solving every problem from how to write a modular and complex web application (Spring) right down to getting basic date and time arithmetic right (Jodatime). The tooling in space from IDEs such as Eclipse and Intellij right through to build systems like gradle and maven is unrivaled.
Unfortunately, over the years Java has acquired a bit of a reputation as a staid development choice that has failed to evolve with the times, in part because it has been popular for a long period of time; familiarity breeds contempt. And of course, there have been genuine issues around the evolution of Java. The decision to maintain backward compatibility, despite its benefits, has complicated this.
Fortunately, the arrival of Java 8 signals not just an incremental improvement in the language but a step change in its development. Unlike Java 6 and 7, this release doesn’t equate to a few minor library improvements. I fully expect and hope that future releases of Java will continue the rapid pace of improvement seen with Java 8. That’s not just because I’ve enjoyed writing a book on the topic! I really do think that there is a long way to go in terms of improving the fundamental task of programming: making code easier to read, clarifying its intent, making it easier to write high-performance code. My only regret is that there isn’t enough space in this concluding chapter to detail the full potential of future releases.
We’re nearing the end of this book, but I hope we’re not nearing the end of your time with Java 8. I’ve covered a bunch of different ways you can use lambda expressions: better collections library code, data parallelism, simpler and cleaner code, and finally concurrency. I’ve explained the why, what, and how, but it is still up to you to put everything into practice. In this spirit, here is a series of open exercises to which there are no right and wrong answers. Undertaking them can help guide your ongoing learning experience:
CompletableFuture
.
Have a look at the design and architecture of a code base you know really well: