Book review (partial): Java Generics and Collections

The book Java Generics and Collections (O’Reilly 2007) by Maurice Naftalin and Philip Wadler provides a grand tour of generics as available within Java. I feel I have a much better handle on the topic now. I only read the first part of the book (the rest is about Collection classes). What the book lacks […]

Java Annotations – a conceptual overview

I’ve been a casual user of annotations in code for many years but had never bothered to understand how exactly they work, or why they even exist. I would pop in the requisite Hibernate, Spring or Lombok annotations where necessary and get on with it. If the answer to the question “Why do annotations exist?” […]

ListenableFuture vs CompletableFuture — a comparison

In my previous blog post I wrote about how Google Guava’s ListenableFuture is an improvement over Java 6’s Future class. But Java 8 ships with a CompletableFuture class that brings much of the same benefits into the standard Java API. The below code example (again with inline comments) shows how to use CompletableFuture to implement […]

How is Google Guava ListenableFuture better than Java Future?

Google Guava’s concurrency classes provide some advantages over using Java’s default classes. Guava’s Futures offer the following benefits: You can add “listeners” to the result of a Future’s success or failure, instead of explicitly checking for the return of the Future.get(), handling exceptions and so on You can chain multiple asynchronous pieces of code together […]

The feel of Java, and Go

In an article titled The Feel of Java (PDF), James Gosling, one of the language’s creators, explains the design choices which went into the making of that language. He states frankly that Java was not meant to be innovative, but instead tried to synthesize a few carefully chosen long existing ideas to form a coherent […]