A simple RxJava 2 “Hello, world” example

As a brief note, and assuming that you already know a little bit about RxJava, here’s the simplest possible RxJava 2 “Hello, world” example I think you can create:

package hello;

import io.reactivex.Observable;

public class HelloWorld {

    public static void main(String[] args) {
        Observable<String> observable = Observable.just("Hello, world");


Functional programming leads to happiness

As I wrote in Functional Programming, Simplified, functional programming can lead to happiness (and sanity). The quotes in this slide from Rúnar Bjarnason’s FP talk expand on what I wrote in my book. They keys are that pure functions are very simple, and you don’t have to constantly worry about the mutable state in your application.

Kent Beck’s Four Rules of Software Design (also known as “Simple Design”)

For the first time in many years I just came across Kent Beck’s Four Rules of Software Design:

  1. Passes the tests
  2. Reveals intention (should be easy to understand)
  3. No duplication (DRY)
  4. Fewest elements (remove anything that doesn’t serve the three previous rules)

There are wording variations on those rules, but I got those specific words from this Martin Fowler post. As he notes, “The rules are in priority order, so ‘passes the tests’ takes priority over ‘reveals intention.’”

For more information on Kent Beck’s Four Rules of Software Design, see that link, or this link to the original rules on

What’s the easiest way to learn functional programming?

People occasionally ask me, “What’s the easiest way to learn functional programming?” If you look at all of the books on the right side of this image, I can tell you that reading all of those books wasn’t an easy way to learn functional programming (FP):

IMHO there’s a much easier way to learn the FP basics: I’ve made almost 40% of my book, Functional Programming, Simplified, freely available.

Writing tip: Just say what you mean

Somewhere around the year 2006, my writing style was influenced by the CIO of a company I was working with. When trying to get a new project started, a project manager gave me a very vague description of what he wanted, and as a result, the cost estimate and Statement of Work I wrote (so I would get paid) was vague as well.

The CIO called me to her office, and then told me that I didn’t have to write anything fancy, I just had to “say what I mean.” Since then, that simple approach has been a key to my writing style.

An Akka actors ‘remote’ example

While doing some crazy things with SARAH, I realized that the best way to solve a particular problem was to use remote Akka actors. I haven’t had the opportunity to work with Akka much since finishing the Scala Cookbook, so I dug around trying to find a simple Akka remote “Hello, world” example. Unable to find a good one, I read some stuff, and created it myself.

Homage to an old, simple user interface

I’m currently working on getting two new books printed, and as I was working with the Create Space UI today, it occurred to me that I like their UI. It’s a simple, Web 1.0 UI, but everything is fairly simple, obvious, and easy to understand. The simple overlap of the rectangles shows that there is an order/flow to the way things need to be done, and they also show the status of each task. I even like that they have an “Icon Legend” on the screen. As a part-time designer and minimalist I’d like to get rid of the underlines under the hyperlinks, but in general I don’t have any huge problems with their UI.

(By contrast, if you’ve tried to use Yahoo’s webmail product during the last few months, you can see a horrible Web 2.0 UI. The designers/engineers try to do too many things, none of them well.)

Simplify, simplify, simplify (programming Scala methods)

I saw a Scala method recently that was written like this:

def abs (i: Int): Int = {
    if (i < 0) -i
    else i

There’s nothing wrong with this method, especially if you’re new to Scala. The method does one thing, and it’s very readable. However, it’s important to know that you can do a number of things to simplify the method.

The return type isn’t needed

First, in cases like this where the return type is obvious, you can remove it: