Alex Whiteside
Purposeful Development

Purposeful Development

One of the most impactful things I do when creating something new in software - whether a function, class or repository, is to give it a 'Purpose', a short sentence or two that explains what the component is intended to do. This may be very high level, in the case of a repository or a very complex class, or very specific in the case of a function. At any level, it should always be specific enough to be able to judge later whether code belongs to it, or somewhere else, and to be able to know at a glance what it intends to do.

Example: Clipboard

Let's say we were creating the clipboard concept in an operating system, we could decide on this purpose:

{"class":"inline-float-right"}

This purpose defines some clear boundaries and expectations of our clipboard:

  1. It provides actions called "Copy" and "Paste"

  2. It's shared by all applications / global

  3. It is mostly un-opinionated about what can be copied/pasted

Just as important is what we left out of the purpose:

  1. how the data is stored while being copied

  2. what the limited structure imposed is

Together these intents help both developers and non-technical folks quickly understand if they can rely on it to support their use case or determine whether new functionality belongs inside.

Let's define a few related components, such as Keyboard Shortcuts and an Action Registry, as well as give Copy and Paste each a clear purpose. This allows us to ensure there's no conflicts or overlaps among components conceptually and helps align developers and stakeholders without getting into implementation details.

When to give something purpose

In general, I find it useful to define the purpose of anything

Writing Useful Purposes

While This may sound like "separation of concerns" or "single responsibility principal", but its more than that. It's a forcing function that requires you to frame the solution and create clear boundaries. These boundaries help us understand and safely make changes both within a component and among components. They are the essence of software.

Alignment with other methodologies

Domain Driven Design uses the term Ubiquitous Language to refer to significant concepts that align with the business.

Every Thing should have a Purpose

Even if you are just trying something out, and need to get the idea out of your head in code, making a habit of this .