Quantcast
Channel: The Canny Coder » Functional Programming
Browsing latest articles
Browse All 10 View Live

Image may be NSFW.
Clik here to view.

An Introduction to Functional Programming with Java 8

Java 8 is perhaps one of the most exciting editions of the Java language in recent times. One of the headline features is support for functional programming which is the focus of this blog. The support...

View Article



Image may be NSFW.
Clik here to view.

Introduction to Functional Programming in Java 8 – Part Two

Welcome to Part Two! To begin this session, let’s start with a return to our HelloWorld example from the last article. public class HelloWorldConcise { private void doPrint(String str) {...

View Article

Image may be NSFW.
Clik here to view.

Ranges and Looping with IntStream

In the previous posts we looked at taking a container, getting it to stream its contents into a pipeline and looked at a few different operations on data in that pipeline (forEach, map, filter, peek)....

View Article

Image may be NSFW.
Clik here to view.

Generators with Java 8

Today we’ll look at creating generators. In simple terms, a generator is a function which returns the next value in a sequence. Unlike an iterator, it generates the next value when needed, rather than...

View Article

Image may be NSFW.
Clik here to view.

Finite sequence generators in Java 8

… and introducing default methods. Last time we looked at generators, and more specifically those generating an infinite sequence. We saw that there were several ways to achieve this: The older Java 7...

View Article


Image may be NSFW.
Clik here to view.

Finite Sequence Generators in Java 8 – Part 2

In the last couple of articles we looked at generators. First we looked at ways of generating an infinite sequence. In the second we saw a way of generating a finite sequence. Let’s look at a few more...

View Article

Image may be NSFW.
Clik here to view.

Optional: Java 8’s way to deal with null

For those who have been programming Java or C/C++ for any period of time will know one of the most annoying things is trying to debug a crash due accessing a null object. While the concept of null is...

View Article

Image may be NSFW.
Clik here to view.

Collectors Part 1 – Reductions and Short-Circuiting Operations‏

In the first couple of articles we looked at streams. We saw that we could take something simple such as a list of countries, filter or map their names and then print them via a foreach. We then looked...

View Article


Image may be NSFW.
Clik here to view.

Collectors Part 2: Provided collectors and a Java 8 streams demonstration

Today we’re going to continue where the last article left off. In that one we looked at collectors, specifically reduction and short-circuiting operations. Today we’ll look at the collect function and...

View Article


Image may be NSFW.
Clik here to view.

Parallel Streams and Spliterators

Today we are going to look at one of the aspects where using streams is a real win – when we need to thread work. As well as parallel streams, we will also look at Spliterators which acts as the...

View Article
Browsing latest articles
Browse All 10 View Live




Latest Images