
finner
My travels with Modern Java in Action
As one of my New Year resolutions is to read more tech I’ve decided on an attempt to document my travels in Mannings Modern Java in Action
I have just started and currently reading the introductory sections which are generic. The book will take me through whats new in Java 8, 9, 10 & 11 with some of the main topics being lambdas, streams, functional & reactive programming.
Java release timeline relevant to the book.
- Java 5 2004
- Java 8 2014
- Java 9 2017
- Java 10 2018 (March)
- Java 11 2018 (September)
As you can see, Java was slow to evolve between Java 5 and 8, a whole 10 years slow. So I guess I got lazy.
Java 8 is the first version of Java with functional programming capabilities.
As of today Java is almost at version 16. Oracle have been on a 6 month release cycle since Java 9. This means the Java community will have to keep up with the pace. This may also inject life back into the old language.
I have high expectations for this book and it has been given positive reviews. There is a lot of material.
With 2 years working experience already in Java 8 I should have a solid foundation to follow what this book will cover. I am hoping to fill in gaps and maybe deep dive in some areas.
So, let’s see how it goes.
Most Liked

finner
Slap bang in the middle of Chapter 5 already which talks about the Stream
API and lovin’ it …
… but I’m getting ahead of myself.
The big change for long time Java programmers is the jump to Java 8. Quite literally it is the ability switch from coding in OO to coding in FP. When written well, Java8 code looks quite different to its previous versions.
Here is a very simple example.
Pre Java 8
Using a for
loop to iterate a list of String
objects.
This is known as external iteration.
public String findWordInList(String wordToFind, List<String> words) {
for (String word: words) {
if (word.equals(wordToFind)) {
return word;
}
}
return "";
}
Java 8
The same as above but using filter()
& findFirst()
from the Stream
API and a lambda predicate. This is known as internal iteration.
public String findWordInList(String word, List<String>) {
return words.stream()
.filter(w -> w.equals(wordToFind))
.findFirst()
.orElse("");
}
The advantage of internal iteration is that the Stream library can choose a data representation and implementation of parallelism.
To use parallelism you just need to rewrite your code as follows:
public String findWordInList(String word, List<String>) {
return words.parallelStream()
.filter(w -> w.equals(wordToFind))
.findFirst()
.orElse("");
}
When I see a for
statement in code at work these days I experience something akin to being asked to believe that Harry Potter is 14 years old in Harry Potter and the Deathly Hollows.
to be continued …

finner
Totally agree @iPaul , there has to be general consensus between the developers in which style to adopt. What I am seeing at the moment where I work is the heavy use of the Stream
API when working with collections. This gives the developer an API similar to FP patterns, such as map
, flatMap
, filter
& reduce
. This feels like a natural step towards a functional style without diving in at the deep end.
In my case, the project has 4 teams, 3 of which are external vendors and it is our team who are behind the curve and struggling with the new concepts. Adapting to the other teams code styles has been a struggle for us but already, for me at least, it has helped me a great deal. You have to swallow your pride when you do not know what you do not know.
So coming back to your point, we are actually the alienated team. We are still trying to catch up but at least now I know what I want my code to look like when I grow up
But just to clarify, Java 8 is still fundamentally an OO language with some FP features. We are still writing and thinking in OO. But I am hoping with all these new features and practice I will be able to revisit FP languages like Clojure or Scala with more confidence and a deeper appreciation for the mindset.
One must be able to dream …

AstonJ
Nice one Finner!
I am sure your journal is going to provide interesting for a lot of people and I look forward to seeing your updates
Popular General Dev topics









Other popular topics










Latest in General Dev
Latest (all)
Categories:
Popular Portals
- /elixir
- /rust
- /wasm
- /ruby
- /erlang
- /phoenix
- /keyboards
- /js
- /rails
- /python
- /security
- /go
- /swift
- /vim
- /clojure
- /java
- /haskell
- /emacs
- /svelte
- /onivim
- /typescript
- /crystal
- /c-plus-plus
- /tailwind
- /kotlin
- /gleam
- /react
- /flutter
- /elm
- /ocaml
- /vscode
- /opensuse
- /ash
- /centos
- /php
- /deepseek
- /zig
- /scala
- /html
- /debian
- /nixos
- /lisp
- /agda
- /sublime-text
- /textmate
- /react-native
- /kubuntu
- /arch-linux
- /ubuntu
- /revery
- /manjaro
- /spring
- /django
- /diversity
- /nodejs
- /lua
- /c
- /slackware
- /julia
- /neovim