The importance of going deep

The importance of going deep

The term being a Stackoverflow-, copy&paste- or auto-complete-developer is nothing new. But even if this is frowned upon in our industry, we all do it. But there is a underlaying problem. Today there is a large focus on pushing out features, and time-to-market, not just leading to technical debt and bad code, it also just gives us developer only time to focus on the business logic. The pace of the information flow and the fear of being overrun by the…

Read More Read More

Terminal and Intermediate operations in the Java 8 Stream API

Terminal and Intermediate operations in the Java 8 Stream API

When working with the Stream API in Java 8, there are two groups of methods that you need to be aware of. These two groups are referred to as terminal and intermediate operators. Intermediate operators These are the methods in the Stream API that returns a new Stream, these are: distinct – Will only let through unique values, based on the objects equals method. filter – Takes a Predicate that should return true or false. True if the object should…

Read More Read More

Currying in Java 8

Currying in Java 8

In the new Java functional library, there are a set of interfaces for supporting Lambda expressions (the lambda expression is cast to appropriate interface). Example of these are Function and BiFunction, where the later takes two arguments and returns nothing. But what if we want to create a Lambda expression with more than two arguments? You can always create your own functional interface, that can take the number of arguments that you want. public interface TriFunction<T, U, V, R> {…

Read More Read More

Method References in Java 8

Method References in Java 8

Method references is a way to pass a reference to a method, that can be invoked at a later stage, with Lambdas. The criteria to a method reference, as with all Lambda expressions, is that it can be assigned to a functional interface. There are 4 different kinds of method references: Reference to a static method When the reference is a static method in a class, for example String::valueOf in the example below. Note, System.out returns an Object, so System.out::println…

Read More Read More

Lambdas in Java 8

Lambdas in Java 8

Java 8 has been out for a while now, and there are a lot of great posts about all the new features, but I’m preparing an introduction for a team that just started to use Java 8, so I thought I could just as well publish my notes as a blog post. Lambdas are actual “just” another way of creating anonymous inner classes, in the pre Java 8 world, we had to write: JButton jButton = new JButton(); jButton.addActionListener(new ActionListener()…

Read More Read More

A blowback

A blowback

Last year I started my company and what I though was going to be a great new journey in my life, but how wrong I was. But it thought me a lesson and started something I hope will be even greater. My developer career started in 2004, after I graduated from the university (Halmstad University) and I got my first full-time job as a database developer. I was one of the top students in my class,  and my passion and ambitiousness…

Read More Read More