Functional programming languages, whether in Java, F#, or Clojure, share several common features. Functional programming is based off lambda calculus by Alonzo Church. The rules of lambda calculus have been applied in making languages more functional. The three lambda calculus rules that influence functional programming are:
- Functions are like mathematical functions. One-and-only-one return exists for each function argument or arguments.
- Variables are immutable. They don’t vary.
- Functions and variables are inter-changable.
This post will go over some of the common features that result from following these rules.
Continue reading “Functional Programming”
Java 8 introduced Lambda expressions. We’ve been told they would bring simpler easier-to-read programs. We’ve been told that Lambda expressions create multi-core friendly code. Functional programs created with Lambda expressions have fewer bugs, saving development time and maintenance costs. Rumor has it that the release of Java 8 was the moment when the rise of the oceans began to slow and our planet began to heal; it was the moment when we ended all language wars and secured Java’s image as the last, best hope on Earth.
I’m not saying it’s all true. That’s just what I’ve heard.
To decipher rumor from truth, we need to start with some basics. There is a lot of complex, albeit cool, stuff that the experts can do with Lambda expressions. We’ll start with a basic tutorial on how to use a Lambda expression to implement a Runnable.
Continue reading “Implementing Runnables the Lambda Way”