American Spellings


Advice

Use American spellings to increase consistency with platform frameworks and reduce cognitive dissonance when reading code.


Context

When working with a language or framework that uses American English spellings, it makes sense to stay consistent - even if that’s not how you’d normally write it.

Take this line of Swift

let colour: Color = colour ?? Colours.default.color

Instead of being a clean, readable statement, it feels like the author is arguing with the framework. Not everyone is affected by this, but for many readers, the alternating spellings become visual noise that distracts from the logic of the code.


Examples

Good

let color: Color = color ?? Colors.default.color

Bad

let colour: Color = colour ?? Colours.default.color