On Naming: Plurals

Matthew Joseph Taylor
2 min readAug 24, 2021
Photo by Brian Harro on Unsplash

I note that in English we can often use an ‘s’ at the end to mean ‘many of’ but sometimes we use an entirely different word.

We say gaggle instead of gooses.

When coding I often use the convention of an ‘s at the end means list-like’ since it is an easy name for a thing ready-to-hand.

I think this works, but it perhaps isn’t as ‘sticky’ a name as using an entirely different word for the plural.

The difference between ‘one’ and ‘many’ is entirely subjective. That was a big ‘aha’ I gained as I’ve delved deeper into functional programming. (I credit my friend Adam Howard for turning me on to this).

A ‘goose’ is just a name for a particular assembly of goose-cells (we often don’t think of individual goose cells as important so they don’t have a particular name).

I think I’ve been missing a trick by shying away from giving my plurals proper names in my code.

By giving the plural a particular name I give it more ‘power’ in the code, and make it more easily identifiable.

Example

I’m currently working on a game.

I have ‘cards’ in my game.

A collection of cards can be called ‘cards’, or they can be called a ‘hand’.

I note that by calling this collection of things a ‘hand’, it is slightly easier to reason about, as I coerce the ‘many of’ to become ‘one’.

Take Away

Being a good ‘namer’ is IMHO one of the strengths of any good creator. Especially those that do any form of ‘world building’, aka writing meant to be read and understood in a metaphorical way.

The cpu has no clue what a ‘hand’ is, I’m borrowing the human-reader’s brain when I use that word. ‘Hand’ is a metaphor. A tower of metaphors. A ‘card-hand’ borrows from the ‘human-hand’ to get part of its meaning.

I expect the ‘human-hand’ also borrowed part of its meaning from something else called ‘hand’, though perhaps that link has been lost to time.

I view ‘programming’ or ‘coding’ as a form of world-building. Same as any other word-smith/fiction-writer.

Coding in my mind is simply ‘fiction with effect’. The magic of turning mere ‘words’ into something that touches the ‘real-world’ is sorcery pure and simple. Programmers are the closest thing to ‘real magicians’ we have in the modern world.

I invite you, dear reader, to give a bit more care when naming those list-like things. Think about how one can play with the always-arbitrary difference between one and many.

How naming is important in ‘coding’.

How by naming one creates the world around oneself in ‘coding’ and in ‘life’.

--

--

Matthew Joseph Taylor

I play with the bits and the bits play with me. See mjt.dev for more.