simple

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 c2.com.

What’s the easiest way to learn functional programming? alvin January 28, 2018 - 3:40pm

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:

MySQL backup - How to backup a MySQL database alvin January 9, 2012 - 9:40am

MySQL database FAQ: How do I backup (back up) a MySQL database?

The benefits of a SEP plan

One of the best things about working for a small company is this thing called a SEP plan. In short, an employer that offers a SEP plan can contribute up to 25% of an employee's salary into a qualified retirement account.

Putting that into numbers, let's say I draw a salary of $100,000. With a SEP plan, my company can contribute an additional 25% of that amount ($25,000) into a qualified retirement account in my name. Unlike 401K plans I'm also immediately 100% vested.