Split functionality into small units

Motivation

When you're in the thick of it it is hard to see where you should split up a bit of work. Usually a couple of lines is perfect, but if you're doing something mundane like a switch statement the mental overhead might be higher if you split things up.

One rule that is easy to apply and remember is that someone in your team needs to be comfortable to replace the method within a short span of time. 30 minutes is a number to stay below.

Applicability

Apply this when code is written.

Application

Question yourself before you leave a context if the methods/functions are not too complex or too scattered.

Consequences

You should see more consistent method sizes and more readable code after you've applied this as a team for a while.

The Xebia Essentials Cards

This page is part of the Xebia Essentials, a pack of flash cards about Software Development Done Right. You can get your own deck of Essentials cards in the Xebia store.