Agile Developer Coach & XP Coder (Java et al.) at Freelancer
About
As an agile developer coach and XP coder, Thomas supports numerous teams master their methodical and technical challenges. He's working in projects from classic enterprise monoliths to e-commerce microservices, most of the time using the Java stack. https://twitter.com/thmuch
Stats
Reputation: | 49 |
Pageviews: | 21.8K |
Articles: | 0 |
Comments: | 1 |
Comments
Feb 28, 2018 · Thomas Much
Reading functional code definitely needs some practice! But then the "what" (what steps are computed) is often more clearly to see than the "how" (how is the algorithm implemented in detail) in imperative style.
Of course there's always a tradeoff between conciseness and readability. And if conciseness is the only advantage, I'd always prefer readability. (And what readability means has to be decided by every different team that works on some codebase.)
But in this example I really prefer the expressiveness of the functional Java code! If you compare this example with one of its imperative solutions, it can be quite tricky to understand /what/ the imperative code actually does.